1 """The Version integration."""
3 from __future__
import annotations
7 from pyhaversion
import HaVersion
21 from .coordinator
import VersionDataUpdateCoordinator
23 _LOGGER = logging.getLogger(__name__)
25 type VersionConfigEntry = ConfigEntry[VersionDataUpdateCoordinator]
29 """Set up the version integration from a config entry."""
31 board = entry.data[CONF_BOARD]
33 if board
not in BOARD_MAP:
35 'Board "%s" is (no longer) valid. Please remove the integration "%s"',
45 source=entry.data[CONF_SOURCE],
46 image=entry.data[CONF_IMAGE],
47 board=BOARD_MAP[board],
48 channel=entry.data[CONF_CHANNEL].lower(),
52 await coordinator.async_config_entry_first_refresh()
54 entry.runtime_data = coordinator
55 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
61 """Unload the config entry."""
62 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_unload_entry(HomeAssistant hass, VersionConfigEntry entry)
bool async_setup_entry(HomeAssistant hass, VersionConfigEntry entry)
aiohttp.ClientSession async_get_clientsession(HomeAssistant hass, bool verify_ssl=True, socket.AddressFamily family=socket.AF_UNSPEC, ssl_util.SSLCipherList ssl_cipher=ssl_util.SSLCipherList.PYTHON_DEFAULT)