1
0
mirror of https://github.com/home-assistant/core.git synced 2026-02-15 07:36:16 +00:00

Add switch checks to pylint plugin (#76909)

This commit is contained in:
epenet
2022-08-18 14:48:23 +02:00
committed by GitHub
parent 60c8d95a77
commit c7301a449b

View File

@@ -2036,6 +2036,25 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
],
),
],
"switch": [
ClassTypeHintMatch(
base_class="Entity",
matches=_ENTITY_MATCH,
),
ClassTypeHintMatch(
base_class="ToggleEntity",
matches=_TOGGLE_ENTITY_MATCH,
),
ClassTypeHintMatch(
base_class="SwitchEntity",
matches=[
TypeHintMatch(
function_name="device_class",
return_type=["SwitchDeviceClass", "str", None],
),
],
),
],
"update": [
ClassTypeHintMatch(
base_class="Entity",