Fix more pre-existing ty diagnostics in test files
Continues narrowing SamsungEntityDescription accesses to the correct subclass and asserting Optional write_fn/match_fn/exists_fn fields are set before calling them, per the pattern established in the previous commit.
This commit is contained in:
18 files changed
+430
-122
No files matched your search
@@ -1,7 +1,8 @@
|
||||
"""HA fan-entity mapping tests for the range hood."""
|
||||
|
||||
from typing import ClassVar
|
||||
from typing import ClassVar, cast
|
||||
|
||||
from custom_components.localthings.coordinator import LocalThingsCoordinator
|
||||
from custom_components.localthings.fan import LocalThingsRangeHoodFan
|
||||
from custom_components.localthings.registry.by_type import microwave, range_hood
|
||||
from custom_components.localthings.registry.discovery import discover
|
||||
@@ -39,7 +40,7 @@ def _entity(resources, coordinator=None, registry=range_hood.REGISTRY):
|
||||
)
|
||||
fan_bound = next(item for item in bound if isinstance(item.desc, FanDesc))
|
||||
return LocalThingsRangeHoodFan(
|
||||
coordinator or _FakeCoordinator(resources),
|
||||
cast(LocalThingsCoordinator, coordinator or _FakeCoordinator(resources)),
|
||||
fan_bound,
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user