mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Remove old type casting in esphome (#75475)
This commit is contained in:
parent
c29bd48373
commit
672883e19d
@ -562,13 +562,11 @@ async def platform_async_setup_entry(
|
|||||||
"""Update entities of this platform when entities are listed."""
|
"""Update entities of this platform when entities are listed."""
|
||||||
old_infos = entry_data.info[component_key]
|
old_infos = entry_data.info[component_key]
|
||||||
new_infos: dict[int, EntityInfo] = {}
|
new_infos: dict[int, EntityInfo] = {}
|
||||||
add_entities = []
|
add_entities: list[_EntityT] = []
|
||||||
for info in infos:
|
for info in infos:
|
||||||
if not isinstance(info, info_type):
|
if not isinstance(info, info_type):
|
||||||
# Filter out infos that don't belong to this platform.
|
# Filter out infos that don't belong to this platform.
|
||||||
continue
|
continue
|
||||||
# cast back to upper type, otherwise mypy gets confused
|
|
||||||
info = cast(EntityInfo, info)
|
|
||||||
|
|
||||||
if info.key in old_infos:
|
if info.key in old_infos:
|
||||||
# Update existing entity
|
# Update existing entity
|
||||||
|
Loading…
x
Reference in New Issue
Block a user