async def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool:
try:
myconfig = {
"mindst": config[DOMAIN][CONF_MIN_DST],
"numofd": config[DOMAIN][CONF_NUMBER_OF_DAYS],
"tz": config[DOMAIN][CONF_TIME_ZONE],
"token": config[DOMAIN][CONF_TOKEN],
"devs": config[DOMAIN][CONF_DEVICES],
"haddr": config["http"]["base_url"],
}
hass.http.register_view(Route(hass, myconfig))
hass.components.frontend.async_register_built_in_panel(
"iframe",
"route",
"mdi:routes",
"route",
{"url": "/route/route.html"},
require_admin=False,
)
except:
_LOGGER.error("Check your config")
return False
return True
кусок кода из проверки на конфиг