Fix ty type-check failure in select.py

_display_option read self._bound.desc.display_fn without narrowing
desc's type first, unlike every other method in this class -- desc is
typed as the base SamsungEntityDescription, which has no display_fn
(only SelectDesc does). Cast it, matching the rest of the class.
This commit is contained in:
Marc Billow committed 2026-08-09 00:08:27 +00:00
1 parent f5e99d71e3
commit 94798b5d9b
1 file changed
+1 -1
+1 -1
View File
@@ -97,7 +97,7 @@ class LocalThingsSelect(LocalThingsEntity, SelectEntity):
def _display_option(self, value):
"""Normalize both current state and options through one path."""
display_fn = self._bound.desc.display_fn
display_fn = cast(SelectDesc, self._bound.desc).display_fn
fallback_fn = (
(lambda raw: display_fn(raw, self._resources)) if display_fn is not None else None
)