From e88e6d10305c61123954f0e4a7e5e9d0c64d435f Mon Sep 17 00:00:00 2001 From: John Arild Berentsen Date: Wed, 7 Sep 2016 03:34:28 +0200 Subject: [PATCH] Zwave climate fix and wink cover. (#3205) * Fixes setpoint get was done outside loop * zxt_120 * Wink not migrated to cover * Clarifying debug * too long line * Only add 1 device entity --- homeassistant/components/climate/zwave.py | 13 +++++++++++++ homeassistant/components/wink.py | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/climate/zwave.py b/homeassistant/components/climate/zwave.py index 530e3ea028f..8886762ee4a 100755 --- a/homeassistant/components/climate/zwave.py +++ b/homeassistant/components/climate/zwave.py @@ -63,6 +63,8 @@ def setup_platform(hass, config, add_devices, discovery_info=None): node = zwave.NETWORK.nodes[discovery_info[ATTR_NODE_ID]] value = node.values[discovery_info[ATTR_VALUE_ID]] value.set_change_verified(False) + if value.index != 1: # Only add 1 device + return add_devices([ZWaveClimate(value, temp_unit)]) _LOGGER.debug("discovery_info=%s and zwave.NETWORK=%s", discovery_info, zwave.NETWORK) @@ -158,6 +160,17 @@ class ZWaveClimate(ZWaveDeviceEntity, ClimateDevice): continue if self._zxt_120: continue + self._target_temperature = int(value.data) + _LOGGER.debug("Get setpoint value: SET_TEMP_TO_INDEX=%s and" + " self._current_operation=%s", + SET_TEMP_TO_INDEX.get(self._current_operation), + self._current_operation) + break + _LOGGER.debug("Get setpoint value not matching any " + "SET_TEMP_TO_INDEX=%s and " + "self._current_operation=%s. Using value.data=%s", + SET_TEMP_TO_INDEX.get(self._current_operation), + self._current_operation, int(value.data)) self._target_temperature = int(value.data) @property diff --git a/homeassistant/components/wink.py b/homeassistant/components/wink.py index 96f40c8d1f7..6d6e09b1918 100644 --- a/homeassistant/components/wink.py +++ b/homeassistant/components/wink.py @@ -41,8 +41,8 @@ def setup(hass, config): ('binary_sensor', pywink.get_sensors), ('sensor', lambda: pywink.get_sensors or pywink.get_eggtrays), ('lock', pywink.get_locks), - ('rollershutter', pywink.get_shades), - ('garage_door', pywink.get_garage_doors)): + ('cover', pywink.get_shades), + ('cover', pywink.get_garage_doors)): if func_exists(): discovery.load_platform(hass, component_name, DOMAIN, {}, config)