Fix testu

This commit is contained in:
Jean-Marc Collin
2025-01-13 17:49:39 +00:00
parent 9628e9a93b
commit 566e0e683c
4 changed files with 15 additions and 10 deletions

View File

@@ -330,7 +330,7 @@ class UnderlyingSwitch(UnderlyingEntity):
_LOGGER.debug("%s - Starting underlying entity %s", self, self._entity_id)
if not await self.check_overpowering():
return
return False
command = SERVICE_TURN_ON if not self.is_inversed else SERVICE_TURN_OFF
domain = self._entity_id.split(".")[0]
@@ -339,6 +339,7 @@ class UnderlyingSwitch(UnderlyingEntity):
data = {ATTR_ENTITY_ID: self._entity_id}
await self._hass.services.async_call(domain, command, data)
self._keep_alive.set_async_action(self._keep_alive_callback)
return True
except Exception:
self._keep_alive.cancel()
raise
@@ -442,7 +443,8 @@ class UnderlyingSwitch(UnderlyingEntity):
time // 60,
time % 60,
)
await self.turn_on()
if not await self.turn_on():
return
else:
_LOGGER.debug("%s - No action on heater cause duration is 0", self)
self._async_cancel_cycle = self.call_later(