1 """The OpenGarage integration."""
3 from __future__
import annotations
12 from .const
import CONF_DEVICE_KEY, DOMAIN
13 from .coordinator
import OpenGarageDataUpdateCoordinator
15 PLATFORMS = [Platform.BINARY_SENSOR, Platform.BUTTON, Platform.COVER, Platform.SENSOR]
19 """Set up OpenGarage from a config entry."""
20 open_garage_connection = opengarage.OpenGarage(
21 f
"{entry.data[CONF_HOST]}:{entry.data[CONF_PORT]}",
22 entry.data[CONF_DEVICE_KEY],
23 entry.data[CONF_VERIFY_SSL],
28 open_garage_connection=open_garage_connection,
30 await open_garage_data_coordinator.async_config_entry_first_refresh()
31 hass.data.setdefault(DOMAIN, {})[entry.entry_id] = open_garage_data_coordinator
33 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
39 """Unload a config entry."""
40 unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
42 hass.data[DOMAIN].pop(entry.entry_id)
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)
bool async_setup_entry(HomeAssistant hass, ConfigEntry 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)