From 0188f2ffec13372308abfc39b78f08f206fdb413 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 19 Feb 2026 17:01:50 +0100 Subject: [PATCH] Mark is_on property as mandatory in binary sensors and toggle entities (#163556) --- pylint/plugins/hass_enforce_type_hints.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pylint/plugins/hass_enforce_type_hints.py b/pylint/plugins/hass_enforce_type_hints.py index 08ae1ac3767..7103abcecf0 100644 --- a/pylint/plugins/hass_enforce_type_hints.py +++ b/pylint/plugins/hass_enforce_type_hints.py @@ -798,6 +798,7 @@ _TOGGLE_ENTITY_MATCH: list[TypeHintMatch] = [ TypeHintMatch( function_name="is_on", return_type=["bool", None], + mandatory=True, ), TypeHintMatch( function_name="turn_on", @@ -939,6 +940,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { TypeHintMatch( function_name="is_on", return_type=["bool", None], + mandatory=True, ), ], ),