Tado: fix 113982 (#114109)

fix-113982
This commit is contained in:
Niels Perfors 2024-03-24 13:28:09 +01:00 committed by GitHub
parent d4b180cf75
commit db3eeec78c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,6 @@
"""Support for the (unofficial) Tado API.""" """Support for the (unofficial) Tado API."""
from datetime import timedelta from datetime import datetime, timedelta
import logging import logging
from PyTado.interface import Tado from PyTado.interface import Tado
@ -439,7 +439,8 @@ class TadoConnector:
def set_meter_reading(self, reading: int) -> dict[str, str]: def set_meter_reading(self, reading: int) -> dict[str, str]:
"""Send meter reading to Tado.""" """Send meter reading to Tado."""
dt: str = datetime.now().strftime("%Y-%m-%d")
try: try:
return self.tado.set_eiq_meter_readings(reading=reading) return self.tado.set_eiq_meter_readings(date=dt, reading=reading)
except RequestException as exc: except RequestException as exc:
raise HomeAssistantError("Could not set meter reading") from exc raise HomeAssistantError("Could not set meter reading") from exc