Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions custom_components/hass_datapoints/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import UnitOfTime
from homeassistant.core import HomeAssistant
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.event import async_call_later, async_track_time_interval
Expand Down Expand Up @@ -144,7 +144,8 @@ async def async_added_to_hass(self) -> None:
self._hass, self._handle_time_interval, _UPDATE_INTERVAL
)
)


@callback
def _handle_time_interval(self, now: datetime) -> None:
"""Refresh state on every timer tick."""
self._attr_native_value = self._compute()
Expand Down