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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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",