1 """Helpers to help coordinate updates."""
3 from pypalazzetti.client
import PalazzettiClient
4 from pypalazzetti.exceptions
import CommunicationError, ValidationError
11 from .const
import DOMAIN, LOGGER, SCAN_INTERVAL
13 type PalazzettiConfigEntry = ConfigEntry[PalazzettiDataUpdateCoordinator]
17 """Class to manage fetching Palazzetti data from a Palazzetti hub."""
19 config_entry: PalazzettiConfigEntry
20 client: PalazzettiClient
26 """Initialize global Palazzetti data updater."""
31 update_interval=SCAN_INTERVAL,
37 await self.
clientclient.connect()
38 await self.
clientclient.update_state()
39 except (CommunicationError, ValidationError)
as err:
40 raise UpdateFailed(f
"Error communicating with the API: {err}")
from err
43 """Fetch data from Palazzetti."""
45 await self.
clientclient.update_state()
46 except (CommunicationError, ValidationError)
as err:
47 raise UpdateFailed(f
"Error communicating with the API: {err}")
from err
None __init__(self, HomeAssistant hass)
None _async_update_data(self)