|
1 | 1 | """Crypto tracking."""
|
| 2 | + |
2 | 3 | from datetime import timedelta
|
3 | 4 | import logging
|
4 | 5 |
|
5 | 6 | from homeassistant.config_entries import ConfigEntry
|
6 |
| -from homeassistant.core import Config, HomeAssistant |
| 7 | +from homeassistant.const import Platform |
| 8 | +from homeassistant.core import HomeAssistant |
| 9 | +from homeassistant.helpers.typing import ConfigType |
7 | 10 | from homeassistant.exceptions import ConfigEntryNotReady
|
8 | 11 | from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
9 | 12 | from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
|
14 | 17 | SCAN_INTERVAL = timedelta(hours=3)
|
15 | 18 |
|
16 | 19 | _LOGGER: logging.Logger = logging.getLogger(__package__)
|
17 |
| -PLATFORMS = ["sensor"] |
| 20 | +PLATFORMS: list[Platform] = [ |
| 21 | + Platform.SENSOR, |
| 22 | +] |
| 23 | + |
18 | 24 |
|
19 |
| -async def async_setup(hass: HomeAssistant, config: Config): |
| 25 | +async def async_setup(hass: HomeAssistant, config: ConfigType): |
20 | 26 | """Set this integration using YAML is not supported."""
|
21 | 27 | return True
|
22 | 28 |
|
@@ -70,7 +76,7 @@ async def _async_update_data(self):
|
70 | 76 | async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
71 | 77 | """Handle removal of an entry."""
|
72 | 78 | # coordinator = hass.data[DOMAIN][entry.entry_id]
|
73 |
| - unloaded = await hass.config_entries.async_unload_platforms(entry, "sensor") |
| 79 | + unloaded = await hass.config_entries.async_unload_platforms(entry, PLATFORMS) |
74 | 80 | if unloaded:
|
75 | 81 | hass.data[DOMAIN].pop(entry.entry_id)
|
76 | 82 |
|
|
0 commit comments