FIX is_device_active
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user