Fix ema_temp unknown and remove slope smoothing

This commit is contained in:
Jean-Marc Collin
2023-11-18 18:08:33 +00:00
parent 41ae572875
commit 328f5f7cb0
3 changed files with 8 additions and 5 deletions

View File

@@ -253,7 +253,7 @@ class BaseThermostat(ClimateEntity, RestoreEntity):
self._underlyings = []
self._smooth_temp = None
self._ema_temp = None
self._ema_algo = None
self.post_init(entry_infos)

View File

@@ -1,3 +1,4 @@
# pylint: disable=line-too-long
""" This file implements the Open Window by temperature algorithm
This algo works the following way:
- each time a new temperature is measured
@@ -71,10 +72,10 @@ class WindowOpenDetectionAlgorithm:
)
return lspe
if self._last_slope is None:
self._last_slope = new_slope
else:
self._last_slope = (0.5 * self._last_slope) + (0.5 * new_slope)
# if self._last_slope is None:
self._last_slope = round(new_slope, 4)
# else:
# self._last_slope = (0.5 * self._last_slope) + (0.5 * new_slope)
self._last_datetime = datetime_measure
self._last_temperature = temperature