1 """The Raspberry Pi hardware platform."""
3 from __future__
import annotations
10 from .const
import DOMAIN
13 "rpi":
"Raspberry Pi",
14 "rpi0":
"Raspberry Pi Zero",
15 "rpi0-w":
"Raspberry Pi Zero W",
16 "rpi2":
"Raspberry Pi 2",
17 "rpi3":
"Raspberry Pi 3 (32-bit)",
18 "rpi3-64":
"Raspberry Pi 3",
19 "rpi4":
"Raspberry Pi 4 (32-bit)",
20 "rpi4-64":
"Raspberry Pi 4",
21 "rpi5-64":
"Raspberry Pi 5",
38 def async_info(hass: HomeAssistant) -> list[HardwareInfo]:
39 """Return board info."""
41 raise HomeAssistantError
43 if (board := os_info.get(
"board"))
is None:
44 raise HomeAssistantError
45 if not board.startswith(
"rpi"):
46 raise HomeAssistantError
49 entry.entry_id
for entry
in hass.config_entries.async_entries(DOMAIN)
55 hassio_board_id=board,
57 model=MODELS.get(board),
60 config_entries=config_entries,
62 name=BOARD_NAMES.get(board, f
"Unknown Raspberry Pi model '{board}'"),
dict[str, Any]|None get_os_info(HomeAssistant hass)
list[HardwareInfo] async_info(HomeAssistant hass)