1 """The DirecTV integration."""
3 from __future__
import annotations
5 from datetime
import timedelta
7 from directv
import DIRECTV, DIRECTVError
15 from .const
import DOMAIN
17 PLATFORMS = [Platform.MEDIA_PLAYER, Platform.REMOTE]
22 """Set up DirecTV from a config entry."""
27 except DIRECTVError
as err:
28 raise ConfigEntryNotReady
from err
30 hass.data.setdefault(DOMAIN, {})
31 hass.data[DOMAIN][entry.entry_id] = dtv
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)