Home Assistant Unofficial Reference 2024.12.1
coordinator.py
Go to the documentation of this file.
1 """Class representing a Devialet update coordinator."""
2 
3 from datetime import timedelta
4 import logging
5 
6 from devialet import DevialetApi
7 
8 from homeassistant.core import HomeAssistant
9 from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
10 
11 from .const import DOMAIN
12 
13 _LOGGER = logging.getLogger(__name__)
14 
15 SCAN_INTERVAL = timedelta(seconds=5)
16 
17 
19  """Devialet update coordinator."""
20 
21  def __init__(self, hass: HomeAssistant, client: DevialetApi) -> None:
22  """Initialize the coordinator."""
23  super().__init__(
24  hass,
25  _LOGGER,
26  name=DOMAIN,
27  update_interval=SCAN_INTERVAL,
28  )
29  self.clientclient = client
30 
31  async def _async_update_data(self) -> None:
32  """Fetch data from API endpoint."""
33  await self.clientclient.async_update()
None __init__(self, HomeAssistant hass, DevialetApi client)
Definition: coordinator.py:21