Home Assistant Unofficial Reference
2024.12.1
models.py
Go to the documentation of this file.
1
"""Models for Hardware."""
2
3
from
__future__
import
annotations
4
5
from
dataclasses
import
dataclass
6
from
typing
import
Protocol
7
8
from
homeassistant.core
import
HomeAssistant, callback
9
10
11
@dataclass(slots=True)
12
class
BoardInfo
:
13
"""Board info type."""
14
15
hassio_board_id: str |
None
16
manufacturer: str
17
model: str |
None
18
revision: str |
None
19
20
21
@dataclass(slots=True, frozen=True)
22
class
USBInfo
:
23
"""USB info type."""
24
25
vid: str
26
pid: str
27
serial_number: str |
None
28
manufacturer: str |
None
29
description: str |
None
30
31
32
@dataclass(slots=True, frozen=True)
33
class
HardwareInfo
:
34
"""Hardware info type."""
35
36
name: str |
None
37
board: BoardInfo |
None
38
config_entries: list[str] |
None
39
dongle: USBInfo |
None
40
url: str |
None
41
42
43
class
HardwareProtocol
(Protocol):
44
"""Define the format of hardware platforms."""
45
46
@callback
47
def
async_info
(self, hass: HomeAssistant) -> list[HardwareInfo]:
48
"""Return info."""
homeassistant.components.hardware.models.BoardInfo
Definition:
models.py:12
homeassistant.components.hardware.models.HardwareInfo
Definition:
models.py:33
homeassistant.components.hardware.models.HardwareProtocol
Definition:
models.py:43
homeassistant.components.hardware.models.HardwareProtocol.async_info
list[HardwareInfo] async_info(self, HomeAssistant hass)
Definition:
models.py:47
homeassistant.components.hardware.models.USBInfo
Definition:
models.py:22
homeassistant.core
Definition:
core.py:1
core
homeassistant
components
hardware
models.py
Generated by
1.9.1