1 """The UptimeRobot integration."""
3 from __future__
import annotations
5 from pyuptimerobot
import UptimeRobot
14 from .const
import DOMAIN, PLATFORMS
15 from .coordinator
import UptimeRobotDataUpdateCoordinator
19 """Set up UptimeRobot from a config entry."""
20 hass.data.setdefault(DOMAIN, {})
21 key: str = entry.data[CONF_API_KEY]
22 if key.startswith((
"ur",
"m")):
24 "Wrong API key type detected, use the 'main' API key"
27 dev_reg = dr.async_get(hass)
31 config_entry_id=entry.entry_id,
36 await coordinator.async_config_entry_first_refresh()
38 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
44 """Unload a config entry."""
45 unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
47 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)