Make sure we exit loop when value is set (#2326)

This commit is contained in:
John Arild Berentsen 2016-06-20 07:42:23 +02:00 committed by Paulus Schoutsen
parent cbc0833360
commit 5efa076080
2 changed files with 5 additions and 0 deletions

View File

@ -211,6 +211,7 @@ class ZWaveHvac(ZWaveDeviceEntity, HvacDevice):
value.data = int(round(temperature, 0)) value.data = int(round(temperature, 0))
else: else:
value.data = int(temperature) value.data = int(temperature)
break
def set_fan_mode(self, fan): def set_fan_mode(self, fan):
"""Set new target fan mode.""" """Set new target fan mode."""
@ -218,6 +219,7 @@ class ZWaveHvac(ZWaveDeviceEntity, HvacDevice):
class_id=COMMAND_CLASS_THERMOSTAT_FAN_MODE).values(): class_id=COMMAND_CLASS_THERMOSTAT_FAN_MODE).values():
if value.command_class == 68 and value.index == 0: if value.command_class == 68 and value.index == 0:
value.data = bytes(fan, 'utf-8') value.data = bytes(fan, 'utf-8')
break
def set_operation_mode(self, operation_mode): def set_operation_mode(self, operation_mode):
"""Set new target operation mode.""" """Set new target operation mode."""
@ -225,6 +227,7 @@ class ZWaveHvac(ZWaveDeviceEntity, HvacDevice):
class_id=COMMAND_CLASS_THERMOSTAT_MODE).values(): class_id=COMMAND_CLASS_THERMOSTAT_MODE).values():
if value.command_class == 64 and value.index == 0: if value.command_class == 64 and value.index == 0:
value.data = bytes(operation_mode, 'utf-8') value.data = bytes(operation_mode, 'utf-8')
break
def set_swing_mode(self, swing_mode): def set_swing_mode(self, swing_mode):
"""Set new target swing mode.""" """Set new target swing mode."""
@ -233,3 +236,4 @@ class ZWaveHvac(ZWaveDeviceEntity, HvacDevice):
class_id=COMMAND_CLASS_CONFIGURATION).values(): class_id=COMMAND_CLASS_CONFIGURATION).values():
if value.command_class == 112 and value.index == 33: if value.command_class == 112 and value.index == 33:
value.data = int(swing_mode) value.data = int(swing_mode)
break

View File

@ -156,3 +156,4 @@ class ZWaveThermostat(zwave.ZWaveDeviceEntity, ThermostatDevice):
COMMAND_CLASS_THERMOSTAT_SETPOINT).items(): COMMAND_CLASS_THERMOSTAT_SETPOINT).items():
if int(value.data) != 0 and value.index == self._index: if int(value.data) != 0 and value.index == self._index:
value.data = temperature value.data = temperature
break