diff --git a/homeassistant/components/geniushub/switch.py b/homeassistant/components/geniushub/switch.py index 890ca1578be..874bd0cee7b 100644 --- a/homeassistant/components/geniushub/switch.py +++ b/homeassistant/components/geniushub/switch.py @@ -57,7 +57,7 @@ class GeniusSwitch(GeniusZone, SwitchEntity): """Representation of a Genius Hub switch.""" @property - def device_class(self): + def device_class(self) -> SwitchDeviceClass: """Return the class of this device, from component DEVICE_CLASSES.""" return SwitchDeviceClass.OUTLET diff --git a/pylint/plugins/hass_enforce_type_hints.py b/pylint/plugins/hass_enforce_type_hints.py index 8e9bb6552a5..923b2d013bf 100644 --- a/pylint/plugins/hass_enforce_type_hints.py +++ b/pylint/plugins/hass_enforce_type_hints.py @@ -954,6 +954,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { TypeHintMatch( function_name="device_class", return_type=["ButtonDeviceClass", None], + mandatory=True, ), TypeHintMatch( function_name="press", @@ -1366,6 +1367,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { TypeHintMatch( function_name="device_class", return_type=["CoverDeviceClass", None], + mandatory=True, ), TypeHintMatch( function_name="current_cover_position", @@ -1991,6 +1993,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { TypeHintMatch( function_name="device_class", return_type=["MediaPlayerDeviceClass", None], + mandatory=True, ), TypeHintMatch( function_name="state", @@ -2334,6 +2337,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { TypeHintMatch( function_name="device_class", return_type=["NumberDeviceClass", None], + mandatory=True, ), TypeHintMatch( function_name="capability_attributes", @@ -2633,6 +2637,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { TypeHintMatch( function_name="device_class", return_type=["SwitchDeviceClass", None], + mandatory=True, ), ], ), @@ -2737,6 +2742,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { TypeHintMatch( function_name="device_class", return_type=["UpdateDeviceClass", None], + mandatory=True, ), TypeHintMatch( function_name="in_progress",