hass-core/homeassistant/components/homeassistant_sky_connect/hardware.py
puddly 380f192c93
Expose the SkyConnect integration with a firmware config/options flow (#115363)
Co-authored-by: Stefan Agner <stefan@agner.ch>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Erik <erik@montnemery.com>
2024-04-24 17:06:24 +02:00

34 lines
1 KiB
Python

"""The Home Assistant SkyConnect hardware platform."""
from __future__ import annotations
from homeassistant.components.hardware.models import HardwareInfo, USBInfo
from homeassistant.core import HomeAssistant, callback
from .const import DOMAIN
from .util import get_hardware_variant
DOCUMENTATION_URL = "https://skyconnect.home-assistant.io/documentation/"
@callback
def async_info(hass: HomeAssistant) -> list[HardwareInfo]:
"""Return board info."""
entries = hass.config_entries.async_entries(DOMAIN)
return [
HardwareInfo(
board=None,
config_entries=[entry.entry_id],
dongle=USBInfo(
vid=entry.data["vid"],
pid=entry.data["pid"],
serial_number=entry.data["serial_number"],
manufacturer=entry.data["manufacturer"],
description=entry.data["product"],
),
name=get_hardware_variant(entry).full_name,
url=DOCUMENTATION_URL,
)
for entry in entries
]