FIX is_device_active

This commit is contained in:
Jean-Marc Collin
2023-11-01 23:08:01 +00:00
parent 8282b69209
commit 89b6f0523b
2 changed files with 3 additions and 1 deletions

View File

@@ -212,6 +212,8 @@ switch:
entity_id: select.seche_serviettes_sdb_rdc_cable_outlet_mode
frontend:
extra_module_url:
- /config/www/community/better-thermostat-ui-card/better-thermostat-ui-card.js
themes:
versatile_thermostat_theme:
state-binary_sensor-safety-on-color: "#FF0B0B"

View File

@@ -227,7 +227,7 @@ class UnderlyingSwitch(UnderlyingEntity):
def is_device_active(self):
"""If the toggleable device is currently active."""
real_state = self._hass.states.is_state(self._entity_id, STATE_ON)
return self.is_inversed and not real_state
return (self.is_inversed and not real_state) or (not self.is_inversed and real_state)
# @overrides this breaks some unit tests TypeError: object MagicMock can't be used in 'await' expression
async def turn_off(self):