Home Assistant Unofficial Reference 2024.12.1
hardware.py
Go to the documentation of this file.
1 """The Home Assistant SkyConnect hardware platform."""
2 
3 from __future__ import annotations
4 
5 from homeassistant.components.hardware.models import HardwareInfo, USBInfo
6 from homeassistant.core import HomeAssistant, callback
7 
8 from .const import DOMAIN
9 from .util import get_hardware_variant
10 
11 DOCUMENTATION_URL = "https://skyconnect.home-assistant.io/documentation/"
12 
13 
14 @callback
15 def async_info(hass: HomeAssistant) -> list[HardwareInfo]:
16  """Return board info."""
17  entries = hass.config_entries.async_entries(DOMAIN)
18 
19  return [
21  board=None,
22  config_entries=[entry.entry_id],
23  dongle=USBInfo(
24  vid=entry.data["vid"],
25  pid=entry.data["pid"],
26  serial_number=entry.data["serial_number"],
27  manufacturer=entry.data["manufacturer"],
28  description=entry.data["product"],
29  ),
30  name=get_hardware_variant(entry).full_name,
31  url=DOCUMENTATION_URL,
32  )
33  for entry in entries
34  ]
list[HardwareInfo] async_info(HomeAssistant hass)
Definition: hardware.py:15
HardwareVariant get_hardware_variant(ConfigEntry config_entry)
Definition: util.py:27