8000 Bugfix. climate and covermqt by turbokongen · Pull Request #3130 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Bugfix. climate and covermqt #3130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion homeassistant/components/climate/zwave.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from homeassistant.components.zwave import (
ATTR_NODE_ID, ATTR_VALUE_ID, ZWaveDeviceEntity)
from homeassistant.components import zwave
from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -128,6 +129,7 @@ def update_properties(self):
class_id=COMMAND_CLASS_SENSOR_MULTILEVEL).values():
if value.label == 'Temperature':
self._current_temperature = int(value.data)
self._unit = value.units
# Fan Mode
for value in self._node.get_values(
class_id=COMMAND_CLASS_THERMOSTAT_FAN_MODE).values():
Expand Down Expand Up @@ -186,7 +188,12 @@ def swing_list(self):
@property
def unit_of_measurement(self):
"""Return the unit of measurement."""
return self._unit
if self._unit == 'C':
return TEMP_CELSIUS
elif self._unit == 'F':
return TEMP_FAHRENHEIT
else:
return self._unit

@property
def current_temperature(self):
Expand Down
16 changes: 8 additions & 8 deletions homeassistant/components/cover/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,17 @@ def message_received(topic, payload, qos):
payload = template.render_with_possible_json_value(
hass, value_template, payload)
if payload == self._state_open:
self._state = True
self._state = False
_LOGGER.warning("state=%s", int(self._state))
self.update_ha_state()
elif payload == self._state_closed:
self._state = False
self._state = True
self.update_ha_state()
elif payload.isnumeric() and 0 <= int(payload) <= 100:
self._state = int(payload)
if int(payload) > 0:
self._state = False
else:
self._state = True
self._position = int(payload)
self.update_ha_state()
else:
Expand All @@ -129,11 +133,7 @@ def name(self):
@property
def is_closed(self):
"""Return if the cover is closed."""
if self.current_cover_position is not None:
if self.current_cover_position > 0:
return False
else:
return True
return self._state

@property
def current_cover_position(self):
Expand Down
0