6
6
7
7
from aiohttp import ClientResponseError , InvalidUrlClientError
8
8
9
- from homeassistant .config_entries import ConfigEntry
10
9
from homeassistant .const import Platform
11
10
from homeassistant .core import HomeAssistant
12
11
from homeassistant .exceptions import ConfigEntryAuthFailed , ConfigEntryNotReady
25
24
26
25
27
26
from .const import COORDINATORS , DOMAIN , VINLIST
28
- from .coordinator import MySkodaDataUpdateCoordinator
27
+ from .coordinator import MySkodaConfigEntry , MySkodaDataUpdateCoordinator
29
28
from .error_handlers import handle_aiohttp_error
30
29
from .issues import (
31
30
async_create_tnc_issue ,
49
48
50
49
51
50
def myskoda_instantiate (
52
- hass : HomeAssistant , entry : ConfigEntry , mqtt_enabled : bool = True
51
+ hass : HomeAssistant , entry : MySkodaConfigEntry , mqtt_enabled : bool = True
53
52
) -> MySkoda :
54
53
"""Generic connector to MySkoda REST API."""
55
54
@@ -63,7 +62,7 @@ def myskoda_instantiate(
63
62
return MySkoda (session , get_default_context (), mqtt_enabled = mqtt_enabled )
64
63
65
64
66
- async def async_setup_entry (hass : HomeAssistant , entry : ConfigEntry ) -> bool :
65
+ async def async_setup_entry (hass : HomeAssistant , entry : MySkodaConfigEntry ) -> bool :
67
66
"""Set up MySkoda integration from a config entry."""
68
67
69
68
myskoda = myskoda_instantiate (hass , entry , mqtt_enabled = False )
@@ -125,7 +124,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
125
124
return True
126
125
127
126
128
- async def async_unload_entry (hass : HomeAssistant , entry : ConfigEntry ) -> bool :
127
+ async def async_unload_entry (hass : HomeAssistant , entry : MySkodaConfigEntry ) -> bool :
129
128
"""Unload a config entry."""
130
129
unload_ok = await hass .config_entries .async_unload_platforms (entry , PLATFORMS )
131
130
if unload_ok :
@@ -134,13 +133,13 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
134
133
return unload_ok
135
134
136
135
137
- async def _async_update_listener (hass : HomeAssistant , entry : ConfigEntry ):
136
+ async def _async_update_listener (hass : HomeAssistant , entry : MySkodaConfigEntry ):
138
137
"""Handle options update."""
139
138
# Do a lazy reload of integration when configuration changed
140
139
await hass .config_entries .async_reload (entry .entry_id )
141
140
142
141
143
- async def async_migrate_entry (hass : HomeAssistant , entry : ConfigEntry ) -> bool :
142
+ async def async_migrate_entry (hass : HomeAssistant , entry : MySkodaConfigEntry ) -> bool :
144
143
"""Handle MySkoda config-entry schema migrations."""
145
144
146
145
_LOGGER .debug (
0 commit comments