mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Explicitly allow Mapping type hint in config entry async_update_entry (#63986)
* Allow MappingProxyType in async_update_entry * Add setup type hints to ps4 * Adjust type hint to Mapping Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
b064a24123
commit
59c84f9586
@ -84,7 +84,7 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
||||||
|
|
||||||
|
|
||||||
async def async_migrate_entry(hass, entry):
|
async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
"""Migrate old entry."""
|
"""Migrate old entry."""
|
||||||
config_entries = hass.config_entries
|
config_entries = hass.config_entries
|
||||||
data = entry.data
|
data = entry.data
|
||||||
|
@ -1054,7 +1054,7 @@ class ConfigEntries:
|
|||||||
*,
|
*,
|
||||||
unique_id: str | None | UndefinedType = UNDEFINED,
|
unique_id: str | None | UndefinedType = UNDEFINED,
|
||||||
title: str | UndefinedType = UNDEFINED,
|
title: str | UndefinedType = UNDEFINED,
|
||||||
data: dict | UndefinedType = UNDEFINED,
|
data: Mapping[str, Any] | UndefinedType = UNDEFINED,
|
||||||
options: Mapping[str, Any] | UndefinedType = UNDEFINED,
|
options: Mapping[str, Any] | UndefinedType = UNDEFINED,
|
||||||
pref_disable_new_entities: bool | UndefinedType = UNDEFINED,
|
pref_disable_new_entities: bool | UndefinedType = UNDEFINED,
|
||||||
pref_disable_polling: bool | UndefinedType = UNDEFINED,
|
pref_disable_polling: bool | UndefinedType = UNDEFINED,
|
||||||
@ -1081,7 +1081,7 @@ class ConfigEntries:
|
|||||||
setattr(entry, attr, value)
|
setattr(entry, attr, value)
|
||||||
changed = True
|
changed = True
|
||||||
|
|
||||||
if data is not UNDEFINED and entry.data != data: # type: ignore
|
if data is not UNDEFINED and entry.data != data:
|
||||||
changed = True
|
changed = True
|
||||||
entry.data = MappingProxyType(data)
|
entry.data = MappingProxyType(data)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user