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:
Marc Billow committed 2026-08-03 00:03:08 +00:00
1 parent daf7e3787f
commit 07061c734d
18 files changed
+430 -122

No files matched your search

+3 -1
View File
@@ -7,9 +7,11 @@ capable or not -- exercises it automatically.
"""
from collections import Counter
from typing import cast
import pytest
from custom_components.localthings.coordinator import LocalThingsCoordinator
from custom_components.localthings.entity import _is_included
from custom_components.localthings.registry.adapter import _key
from custom_components.localthings.registry.entities import PLATFORM_OF
@@ -57,7 +59,7 @@ def test_key_is_unique_across_all_bound_entities(name):
oic_res,
seeds,
)
coordinator = _FakeCoordinator(full_resources, materialized)
coordinator = cast(LocalThingsCoordinator, _FakeCoordinator(full_resources, materialized))
included = [b for b in bound if _is_included(b, coordinator)]
keys = [(PLATFORM_OF[type(b.desc)], _key(b)) for b in included]
dupes = {k: n for k, n in Counter(keys).items() if n > 1}