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:
epenet 2022-01-14 04:06:19 +01:00 committed by GitHub
parent b064a24123
commit 59c84f9586
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -84,7 +84,7 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
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."""
config_entries = hass.config_entries
data = entry.data

View File

@ -1054,7 +1054,7 @@ class ConfigEntries:
*,
unique_id: str | None | UndefinedType = UNDEFINED,
title: str | UndefinedType = UNDEFINED,
data: dict | UndefinedType = UNDEFINED,
data: Mapping[str, Any] | UndefinedType = UNDEFINED,
options: Mapping[str, Any] | UndefinedType = UNDEFINED,
pref_disable_new_entities: bool | UndefinedType = UNDEFINED,
pref_disable_polling: bool | UndefinedType = UNDEFINED,
@ -1081,7 +1081,7 @@ class ConfigEntries:
setattr(entry, attr, value)
changed = True
if data is not UNDEFINED and entry.data != data: # type: ignore
if data is not UNDEFINED and entry.data != data:
changed = True
entry.data = MappingProxyType(data)