1 """Coordinate data for powerview devices."""
3 from __future__
import annotations
5 from collections.abc
import Iterable
8 from aiopvapi.helpers.aiorequest
import AioRequest
9 from aiopvapi.helpers.constants
import ATTR_ID
10 from aiopvapi.hub
import Hub
15 from .model
import PowerviewAPI, PowerviewDeviceInfo
20 """Return a dict with the key being the id for a list of entries."""
21 return {entry[ATTR_ID]: entry
for entry
in data}
25 hass: HomeAssistant, address: str, api_version: int |
None =
None
27 """Create the hub and fetch the device info address."""
29 pv_request = AioRequest(
30 address, loop=hass.loop, websession=websession, api_version=api_version
33 await hub.query_firmware()
36 mac_address=hub.mac_address,
37 serial_number=hub.serial_number,
38 firmware=hub.firmware,
def async_map_data_by_id(Iterable[dict[str|int, Any]] data)
PowerviewAPI async_connect_hub(HomeAssistant hass, str address, int|None api_version=None)
aiohttp.ClientSession async_get_clientsession(HomeAssistant hass, bool verify_ssl=True, socket.AddressFamily family=socket.AF_UNSPEC, ssl_util.SSLCipherList ssl_cipher=ssl_util.SSLCipherList.PYTHON_DEFAULT)