Fix point import error (#144462)

* fix import error

* fix failing tests

* Apply suggestions from code review

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
This commit is contained in:
Fredrik Erlandsson 2025-05-08 14:28:56 +02:00 committed by Franck Nijhof
parent e5c56629e2
commit 23244fb79f
No known key found for this signature in database
GPG Key ID: AB33ADACE7101952

View File

@ -6,7 +6,6 @@ import logging
from typing import Any from typing import Any
from pypoint import PointSession from pypoint import PointSession
from tempora.utc import fromtimestamp
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
@ -62,7 +61,9 @@ class PointDataUpdateCoordinator(DataUpdateCoordinator[dict[str, dict[str, Any]]
or device.device_id not in self.device_updates or device.device_id not in self.device_updates
or self.device_updates[device.device_id] < last_updated or self.device_updates[device.device_id] < last_updated
): ):
self.device_updates[device.device_id] = last_updated or fromtimestamp(0) self.device_updates[device.device_id] = (
last_updated or datetime.fromtimestamp(0)
)
self.data[device.device_id] = { self.data[device.device_id] = {
k: await device.sensor(k) k: await device.sensor(k)
for k in ("temperature", "humidity", "sound_pressure") for k in ("temperature", "humidity", "sound_pressure")