-
-
Notifications
You must be signed in to change notification settings - Fork 37.3k
Expand file tree
/
Copy path__init__.py
More file actions
33 lines (23 loc) · 1.07 KB
/
__init__.py
File metadata and controls
33 lines (23 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""The CentriConnect/MyPropane API integration."""
from __future__ import annotations
import logging
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from .coordinator import CentriConnectConfigEntry, CentriConnectCoordinator
_LOGGER = logging.getLogger(__name__)
PLATFORMS: list[Platform] = [Platform.SENSOR]
async def async_setup_entry(
hass: HomeAssistant, entry: CentriConnectConfigEntry
) -> bool:
"""Set up CentriConnect/MyPropane API from a config entry."""
coordinator = CentriConnectCoordinator(hass, entry)
await coordinator.async_config_entry_first_refresh()
entry.runtime_data = coordinator
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True
async def async_unload_entry(
hass: HomeAssistant, entry: CentriConnectConfigEntry
) -> bool:
"""Unload CentriConnect/MyPropane API integration platforms and coordinator."""
_LOGGER.info("Unloading CentriConnect/MyPropane API integration")
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)