From ff5f1aee5372e859143ecbe9bee736d02aebe1d8 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 22 Nov 2022 07:16:29 +0100 Subject: [PATCH] Enforce SirenEntityFeature (#82464) --- homeassistant/components/siren/__init__.py | 4 ++-- pylint/plugins/hass_enforce_type_hints.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/siren/__init__.py b/homeassistant/components/siren/__init__.py index 0bc16d03770..92d547d5760 100644 --- a/homeassistant/components/siren/__init__.py +++ b/homeassistant/components/siren/__init__.py @@ -162,7 +162,7 @@ class SirenEntity(ToggleEntity): entity_description: SirenEntityDescription _attr_available_tones: list[int | str] | dict[int, str] | None - _attr_supported_features: SirenEntityFeature | int = 0 + _attr_supported_features: SirenEntityFeature = SirenEntityFeature(0) @final @property @@ -190,6 +190,6 @@ class SirenEntity(ToggleEntity): return None @property - def supported_features(self) -> SirenEntityFeature | int: + def supported_features(self) -> SirenEntityFeature: """Return the list of 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 1974b789a83..ac8c6e674e0 100644 --- a/pylint/plugins/hass_enforce_type_hints.py +++ b/pylint/plugins/hass_enforce_type_hints.py @@ -2214,7 +2214,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { ), TypeHintMatch( function_name="supported_features", - return_type=["SirenEntityFeature", "int"], + return_type="SirenEntityFeature", ), ], ),