Fix error on empty UOM for ISY994 Climate Device (#36454)
parent
f170c80bea
commit
04231bcb54
|
@ -133,7 +133,7 @@ class ISYThermostatEntity(ISYNodeEntity, ClimateEntity):
|
||||||
# Which state values used depends on the mode property's UOM:
|
# Which state values used depends on the mode property's UOM:
|
||||||
uom = hvac_mode.uom
|
uom = hvac_mode.uom
|
||||||
# Handle special case for ISYv4 Firmware:
|
# Handle special case for ISYv4 Firmware:
|
||||||
if uom == UOM_ISYV4_NONE:
|
if uom in (UOM_ISYV4_NONE, ""):
|
||||||
uom = (
|
uom = (
|
||||||
UOM_HVAC_MODE_INSTEON
|
UOM_HVAC_MODE_INSTEON
|
||||||
if self._node.protocol == PROTO_INSTEON
|
if self._node.protocol == PROTO_INSTEON
|
||||||
|
|
|
@ -83,8 +83,8 @@ class ISYCoverEntity(ISYNodeEntity, CoverEntity):
|
||||||
|
|
||||||
def set_cover_position(self, **kwargs):
|
def set_cover_position(self, **kwargs):
|
||||||
"""Move the cover to a specific position."""
|
"""Move the cover to a specific position."""
|
||||||
position = kwargs.get(ATTR_POSITION)
|
position = kwargs[ATTR_POSITION]
|
||||||
if position and self._node.uom == UOM_8_BIT_RANGE:
|
if self._node.uom == UOM_8_BIT_RANGE:
|
||||||
position = int(position * 255 / 100)
|
position = int(position * 255 / 100)
|
||||||
if not self._node.turn_on(val=position):
|
if not self._node.turn_on(val=position):
|
||||||
_LOGGER.error("Unable to set cover position")
|
_LOGGER.error("Unable to set cover position")
|
||||||
|
|
Loading…
Reference in New Issue