FIX #73, #72. thanks to Salabur

This commit is contained in:
Jean-Marc Collin
2023-04-14 08:24:01 +02:00
parent 81a467b8c3
commit a17423d470
4 changed files with 14 additions and 4 deletions

View File

@@ -54,7 +54,7 @@ class WindowOpenDetectionAlgorithm:
delta_t_sec = float((datetime_measure - self._last_datetime).total_seconds())
delta_t = delta_t_sec / 60.0
if delta_t_sec <= MIN_DELTA_T_SEC:
_LOGGER.warning(
_LOGGER.debug(
"Delta t is %d < %d which should be not possible. We don't consider this value",
delta_t_sec,
MIN_DELTA_T_SEC,
@@ -64,7 +64,7 @@ class WindowOpenDetectionAlgorithm:
delta_temp = float(temperature - self._last_temperature)
new_slope = delta_temp / delta_t
if new_slope > MAX_SLOPE_VALUE or new_slope < -MAX_SLOPE_VALUE:
_LOGGER.warning(
_LOGGER.debug(
"New_slope is abs(%.2f) > %.2f which should be not possible. We don't consider this value",
new_slope,
MAX_SLOPE_VALUE,

View File

@@ -178,6 +178,7 @@ class UnderlyingSwitch(UnderlyingEntity):
if hvac_mode == HVACMode.OFF:
if self.is_device_active:
await self.turn_off()
await self._cancel_cycle()
return True
@property