FIX power float conversion when state unknown
This commit is contained in:
@@ -989,8 +989,10 @@ class VersatileThermostat(ClimateEntity, RestoreEntity):
|
|||||||
_LOGGER.debug(event)
|
_LOGGER.debug(event)
|
||||||
new_state = event.data.get("new_state")
|
new_state = event.data.get("new_state")
|
||||||
old_state = event.data.get("old_state")
|
old_state = event.data.get("old_state")
|
||||||
if new_state is None or (
|
if (
|
||||||
old_state is not None and new_state.state == old_state.state
|
new_state is None
|
||||||
|
or new_state.state in (STATE_UNAVAILABLE, STATE_UNKNOWN)
|
||||||
|
or (old_state is not None and new_state.state == old_state.state)
|
||||||
):
|
):
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -1010,8 +1012,10 @@ class VersatileThermostat(ClimateEntity, RestoreEntity):
|
|||||||
_LOGGER.debug(event)
|
_LOGGER.debug(event)
|
||||||
new_state = event.data.get("new_state")
|
new_state = event.data.get("new_state")
|
||||||
old_state = event.data.get("old_state")
|
old_state = event.data.get("old_state")
|
||||||
if new_state is None or (
|
if (
|
||||||
old_state is not None and new_state.state == old_state.state
|
new_state is None
|
||||||
|
or new_state.state in (STATE_UNAVAILABLE, STATE_UNKNOWN)
|
||||||
|
or (old_state is not None and new_state.state == old_state.state)
|
||||||
):
|
):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user