Fix error on empty UOM for ISY994 Climate Device (#36454)

pull/36463/head
shbatm 2020-06-04 17:22:35 -05:00 committed by GitHub
parent f170c80bea
commit 04231bcb54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -133,7 +133,7 @@ class ISYThermostatEntity(ISYNodeEntity, ClimateEntity):
# Which state values used depends on the mode property's UOM:
uom = hvac_mode.uom
# Handle special case for ISYv4 Firmware:
if uom == UOM_ISYV4_NONE:
if uom in (UOM_ISYV4_NONE, ""):
uom = (
UOM_HVAC_MODE_INSTEON
if self._node.protocol == PROTO_INSTEON

View File

@ -83,8 +83,8 @@ class ISYCoverEntity(ISYNodeEntity, CoverEntity):
def set_cover_position(self, **kwargs):
"""Move the cover to a specific position."""
position = kwargs.get(ATTR_POSITION)
if position and self._node.uom == UOM_8_BIT_RANGE:
position = kwargs[ATTR_POSITION]
if self._node.uom == UOM_8_BIT_RANGE:
position = int(position * 255 / 100)
if not self._node.turn_on(val=position):
_LOGGER.error("Unable to set cover position")