Take Maia feedbacks on the algo.

This commit is contained in:
Jean-Marc Collin
2023-11-18 23:33:40 +00:00
parent 8fe4eb7ac0
commit ae568c8be2
3 changed files with 16 additions and 10 deletions

View File

@@ -4,7 +4,7 @@ from datetime import datetime, timedelta
from homeassistant.core import HomeAssistant
from custom_components.versatile_thermostat.ema import EstimatedMobileAverage
from custom_components.versatile_thermostat.ema import ExponentialMovingAverage
from .commons import get_tz
@@ -15,12 +15,13 @@ def test_ema_basics(hass: HomeAssistant):
tz = get_tz(hass) # pylint: disable=invalid-name
now: datetime = datetime.now(tz=tz)
the_ema = EstimatedMobileAverage(
the_ema = ExponentialMovingAverage(
"test",
# 5 minutes
300,
# Needed for time calculation
get_tz(hass),
1,
)
assert the_ema