1 """The NFAndroidTV integration."""
3 from notifications_android_tv.notifications
import ConnectError, Notifications
13 from .const
import DATA_HASS_CONFIG, DOMAIN
15 PLATFORMS = [Platform.NOTIFY]
17 CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
20 async
def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
21 """Set up the NFAndroidTV component."""
23 hass.data[DATA_HASS_CONFIG] = config
28 """Set up NFAndroidTV from a config entry."""
30 await hass.async_add_executor_job(Notifications, entry.data[CONF_HOST])
31 except ConnectError
as ex:
33 f
"Failed to connect to host: {entry.data[CONF_HOST]}"
36 hass.data.setdefault(DOMAIN, {})
38 hass.async_create_task(
39 discovery.async_load_platform(
44 hass.data[DATA_HASS_CONFIG],
52 """Unload a config entry."""
53 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_setup_entry(HomeAssistant hass, ConfigEntry entry)
bool async_setup(HomeAssistant hass, ConfigType config)
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)