Skip to content

Commit eba8fce

Browse files
committed
Fix DPC setup typing and icons
1 parent 54ffc9a commit eba8fce

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

custom_components/dpc/__init__.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,10 @@
1919
CONF_SCAN_INTERVAL,
2020
)
2121
from homeassistant.core import HomeAssistant
22-
import homeassistant.helpers.config_validation as cv
23-
from homeassistant.helpers.typing import ConfigType
2422
from homeassistant.exceptions import ConfigEntryNotReady
25-
from homeassistant.helpers import config_validation as cv
2623
from homeassistant.helpers import event
27-
import homeassistant.helpers.config_validation as cv
2824
from homeassistant.helpers.aiohttp_client import async_get_clientsession
25+
from homeassistant.helpers.typing import ConfigType
2926
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
3027

3128
from .api import DpcApiClient, DpcApiException
@@ -42,14 +39,13 @@
4239
CONFIG_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):
9086
class 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)

custom_components/dpc/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
21: "mdi:snowflake-variant",
103103
30: "mdi:weather-fog",
104104
31: "mdi:weather-hazy",
105-
40: "mdi:wave",
105+
40: "mdi:waves",
106106
41: "mdi:waves",
107107
42: "mdi:hydro-power",
108108
50: "mdi:arrow-up-thick",

0 commit comments

Comments
 (0)