Skip to content

Commit 6d3dc0a

Browse files
Merge pull request #44 from BigNocciolino/deprecated-fixes
Deprecated fixes
2 parents bfbac1e + e652038 commit 6d3dc0a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

custom_components/cryptostate/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
"""Crypto tracking."""
2+
23
from datetime import timedelta
34
import logging
45

56
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
710
from homeassistant.exceptions import ConfigEntryNotReady
811
from homeassistant.helpers.aiohttp_client import async_get_clientsession
912
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
@@ -14,9 +17,12 @@
1417
SCAN_INTERVAL = timedelta(hours=3)
1518

1619
_LOGGER: logging.Logger = logging.getLogger(__package__)
17-
PLATFORMS = ["sensor"]
20+
PLATFORMS: list[Platform] = [
21+
Platform.SENSOR,
22+
]
23+
1824

19-
async def async_setup(hass: HomeAssistant, config: Config):
25+
async def async_setup(hass: HomeAssistant, config: ConfigType):
2026
"""Set this integration using YAML is not supported."""
2127
return True
2228

@@ -70,7 +76,7 @@ async def _async_update_data(self):
7076
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
7177
"""Handle removal of an entry."""
7278
# 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)
7480
if unloaded:
7581
hass.data[DOMAIN].pop(entry.entry_id)
7682

0 commit comments

Comments
 (0)