Skip to content

Commit 4b84998

Browse files
authored
Fix UFPConfigEntry type consistency in unifiprotect (home-assistant#157548)
1 parent e10c1eb commit 4b84998

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

homeassistant/components/unifiprotect/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# diagnostics module will not be imported in the executor.
1616
from uiprotect.test_util.anonymize import anonymize_data # noqa: F401
1717

18-
from homeassistant.config_entries import ConfigEntry, ConfigEntryState
18+
from homeassistant.config_entries import ConfigEntryState
1919
from homeassistant.const import CONF_API_KEY, EVENT_HOMEASSISTANT_STOP
2020
from homeassistant.core import HomeAssistant
2121
from homeassistant.exceptions import (
@@ -208,7 +208,7 @@ async def async_remove_config_entry_device(
208208
return True
209209

210210

211-
async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
211+
async def async_migrate_entry(hass: HomeAssistant, entry: UFPConfigEntry) -> bool:
212212
"""Migrate entry."""
213213
_LOGGER.debug("Migrating configuration from version %s", entry.version)
214214

homeassistant/components/unifiprotect/config_flow.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
from homeassistant.config_entries import (
1818
SOURCE_IGNORE,
19-
ConfigEntry,
2019
ConfigEntryState,
2120
ConfigFlow,
2221
ConfigFlowResult,
@@ -55,7 +54,7 @@
5554
MIN_REQUIRED_PROTECT_V,
5655
OUTDATED_LOG_MESSAGE,
5756
)
58-
from .data import async_last_update_was_successful
57+
from .data import UFPConfigEntry, async_last_update_was_successful
5958
from .discovery import async_start_discovery
6059
from .utils import _async_resolve, _async_short_mac, _async_unifi_mac_from_hass
6160

@@ -80,7 +79,7 @@ def _host_is_direct_connect(host: str) -> bool:
8079

8180
async def _async_console_is_offline(
8281
hass: HomeAssistant,
83-
entry: ConfigEntry,
82+
entry: UFPConfigEntry,
8483
) -> bool:
8584
"""Check if a console is offline.
8685
@@ -224,7 +223,7 @@ async def async_step_discovery_confirm(
224223
@staticmethod
225224
@callback
226225
def async_get_options_flow(
227-
config_entry: ConfigEntry,
226+
config_entry: UFPConfigEntry,
228227
) -> OptionsFlowHandler:
229228
"""Get the options flow for this handler."""
230229
return OptionsFlowHandler()

homeassistant/components/unifiprotect/repairs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
from homeassistant import data_entry_flow
1212
from homeassistant.components.repairs import ConfirmRepairFlow, RepairsFlow
13-
from homeassistant.config_entries import ConfigEntry
1413
from homeassistant.core import HomeAssistant, callback
1514
from homeassistant.helpers import issue_registry as ir
1615

@@ -165,7 +164,7 @@ async def async_step_confirm(
165164

166165
@callback
167166
def _async_get_or_create_api_client(
168-
hass: HomeAssistant, entry: ConfigEntry
167+
hass: HomeAssistant, entry: UFPConfigEntry
169168
) -> ProtectApiClient:
170169
"""Get or create an API client."""
171170
if data := async_get_data_for_entry_id(hass, entry.entry_id):

0 commit comments

Comments
 (0)