diff --git a/homeassistant/components/version/__init__.py b/homeassistant/components/version/__init__.py index 75545adb8db..22dbad36d7b 100644 --- a/homeassistant/components/version/__init__.py +++ b/homeassistant/components/version/__init__.py @@ -1,6 +1,8 @@ """The Version integration.""" from __future__ import annotations +import logging + from pyhaversion import HaVersion from homeassistant.config_entries import ConfigEntry @@ -18,16 +20,29 @@ from .const import ( ) from .coordinator import VersionDataUpdateCoordinator +_LOGGER = logging.getLogger(__name__) + async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up the version integration from a config entry.""" + + board = entry.data[CONF_BOARD] + + if board not in BOARD_MAP: + _LOGGER.error( + 'Board "%s" is (no longer) valid. Please remove the integration "%s"', + board, + entry.title, + ) + return False + coordinator = VersionDataUpdateCoordinator( hass=hass, api=HaVersion( session=async_get_clientsession(hass), source=entry.data[CONF_SOURCE], image=entry.data[CONF_IMAGE], - board=BOARD_MAP[entry.data[CONF_BOARD]], + board=BOARD_MAP[board], channel=entry.data[CONF_CHANNEL].lower(), ), ) diff --git a/homeassistant/components/version/const.py b/homeassistant/components/version/const.py index 419e49d7240..1693f79ec64 100644 --- a/homeassistant/components/version/const.py +++ b/homeassistant/components/version/const.py @@ -61,8 +61,6 @@ HA_VERSION_SOURCES: Final[list[str]] = [source.value for source in HaVersionSour BOARD_MAP: Final[dict[str, str]] = { "OVA": "ova", - "RaspberryPi": "rpi", - "RaspberryPi Zero-W": "rpi0-w", "RaspberryPi 2": "rpi2", "RaspberryPi 3": "rpi3", "RaspberryPi 3 64bit": "rpi3-64", @@ -73,8 +71,10 @@ BOARD_MAP: Final[dict[str, str]] = { "ODROID C4": "odroid-c4", "ODROID N2": "odroid-n2", "ODROID XU4": "odroid-xu4", + "Generic AArch64": "generic-aarch64", "Generic x86-64": "generic-x86-64", - "Intel NUC": "intel-nuc", + "Home Assistant Yellow": "yellow", + "Khadas VIM3": "khadas-vim3", } VALID_BOARDS: Final[list[str]] = list(BOARD_MAP)