1 """The Goal Zero Yeti integration."""
3 from __future__
import annotations
5 from typing
import TYPE_CHECKING
7 from goalzero
import Yeti, exceptions
15 from .coordinator
import GoalZeroConfigEntry, GoalZeroDataUpdateCoordinator
17 PLATFORMS = [Platform.BINARY_SENSOR, Platform.SENSOR, Platform.SWITCH]
21 """Set up Goal Zero Yeti from a config entry."""
26 assert mac
is not None
31 hass.config_entries.async_update_entry(entry, unique_id=formatted_mac)
35 await api.init_connect()
36 except exceptions.ConnectError
as ex:
40 await entry.runtime_data.async_config_entry_first_refresh()
41 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
47 """Unload a config entry."""
48 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_unload_entry(HomeAssistant hass, GoalZeroConfigEntry entry)
bool async_setup_entry(HomeAssistant hass, GoalZeroConfigEntry 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)