1919 CONF_SCAN_INTERVAL ,
2020)
2121from homeassistant .core import HomeAssistant
22- import homeassistant .helpers .config_validation as cv
23- from homeassistant .helpers .typing import ConfigType
2422from homeassistant .exceptions import ConfigEntryNotReady
25- from homeassistant .helpers import config_validation as cv
2623from homeassistant .helpers import event
27- import homeassistant .helpers .config_validation as cv
2824from homeassistant .helpers .aiohttp_client import async_get_clientsession
25+ from homeassistant .helpers .typing import ConfigType
2926from homeassistant .helpers .update_coordinator import DataUpdateCoordinator , UpdateFailed
3027
3128from .api import DpcApiClient , DpcApiException
4239CONFIG_SCHEMA = cv .config_entry_only_config_schema (DOMAIN )
4340
4441
45-
46-
47- async def async_setup (hass : HomeAssistant , config : ConfigType ):
42+ async def async_setup (hass : HomeAssistant , config : ConfigType ) -> bool :
4843 """Set up this integration using YAML is not supported."""
44+ del config
4945 return True
5046
5147
52- async def async_setup_entry (hass : HomeAssistant , entry : ConfigEntry ):
48+ async def async_setup_entry (hass : HomeAssistant , entry : ConfigEntry ) -> bool :
5349 """Set up this integration using UI."""
5450 if hass .data .get (DOMAIN ) is None :
5551 hass .data .setdefault (DOMAIN , {})
@@ -90,7 +86,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
9086class DpcDataUpdateCoordinator (DataUpdateCoordinator ):
9187 """Class to manage fetching data from the API."""
9288
93- def __init__ (self , hass : HomeAssistant , client : DpcApiClient , update_interval ) -> None :
89+ def __init__ (
90+ self , hass : HomeAssistant , client : DpcApiClient , update_interval : timedelta
91+ ) -> None :
9492 """Initialize."""
9593 self .api = client
9694 self .platforms = []
@@ -118,7 +116,7 @@ async def _async_request_refresh_later(self, _now):
118116 await self .async_request_refresh ()
119117
120118
121- async def async_update_options (hass , config_entry ) :
119+ async def async_update_options (hass : HomeAssistant , config_entry : ConfigEntry ) -> None :
122120 """Update options."""
123121 await hass .config_entries .async_reload (config_entry .entry_id )
124122
@@ -141,7 +139,7 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
141139 return unloaded
142140
143141
144- async def async_migrate_entry (hass , entry ) :
142+ async def async_migrate_entry (hass : HomeAssistant , entry : ConfigEntry ) -> bool :
145143 LOGGER .info ("Migrating DPC entry from Version %s" , entry .version )
146144 if entry .version == 1 :
147145 entry .options = dict (entry .options )
0 commit comments