From 9b9bdc725f3b670875f5479c0ffcb61f50a9a9cb Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 17 Nov 2022 15:06:16 +0100 Subject: [PATCH] Adjust type hints for RemoteEntityFeature (#82265) --- homeassistant/components/remote/__init__.py | 4 ++-- pylint/plugins/hass_enforce_type_hints.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/remote/__init__.py b/homeassistant/components/remote/__init__.py index 74535c44228..bc0711daeb5 100644 --- a/homeassistant/components/remote/__init__.py +++ b/homeassistant/components/remote/__init__.py @@ -166,10 +166,10 @@ class RemoteEntity(ToggleEntity): entity_description: RemoteEntityDescription _attr_activity_list: list[str] | None = None _attr_current_activity: str | None = None - _attr_supported_features: int = 0 + _attr_supported_features: RemoteEntityFeature | int = 0 @property - def supported_features(self) -> int: + def supported_features(self) -> RemoteEntityFeature | int: """Flag supported features.""" return self._attr_supported_features diff --git a/pylint/plugins/hass_enforce_type_hints.py b/pylint/plugins/hass_enforce_type_hints.py index e5cbcca09b2..1f372c6550d 100644 --- a/pylint/plugins/hass_enforce_type_hints.py +++ b/pylint/plugins/hass_enforce_type_hints.py @@ -2052,16 +2052,16 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { base_class="RemoteEntity", matches=[ TypeHintMatch( - function_name="supported_features", - return_type="int", + function_name="activity_list", + return_type=["list[str]", None], ), TypeHintMatch( function_name="current_activity", return_type=["str", None], ), TypeHintMatch( - function_name="activity_list", - return_type=["list[str]", None], + function_name="supported_features", + return_type=["RemoteEntityFeature", "int"], ), TypeHintMatch( function_name="send_command",