1 """Coordinate data for powerview devices."""
3 from __future__
import annotations
6 from datetime
import timedelta
9 from aiopvapi.helpers.aiorequest
import PvApiMaintenance
10 from aiopvapi.hub
import Hub
11 from aiopvapi.shades
import Shades
16 from .const
import HUB_EXCEPTIONS
17 from .shade_data
import PowerviewShadeData
19 _LOGGER = logging.getLogger(__name__)
23 """DataUpdateCoordinator to gather data from a powerview hub."""
25 def __init__(self, hass: HomeAssistant, shades: Shades, hub: Hub) ->
None:
26 """Initialize DataUpdateCoordinator to gather data for specific Powerview Hub."""
36 name=f
"powerview hub {hub.hub_address}",
41 """Fetch data from shade endpoint."""
44 shade_entries = await self.
shadesshades.get_shades()
45 except PvApiMaintenance
as error:
48 except HUB_EXCEPTIONS
as error:
50 f
"Powerview Hub {self.hub.hub_address} did not return any data: {error}"
PowerviewShadeData _async_update_data(self)
None __init__(self, HomeAssistant hass, Shades shades, Hub hub)
None store_group_data(self, PowerviewData shade_data)