Update pylint plugin to use TriggerActionType (#76819)

This commit is contained in:
Marc Mueller 2022-08-16 11:16:33 +02:00 committed by GitHub
parent 7ec54edc69
commit 91005f4694
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -337,8 +337,8 @@ _FUNCTION_MATCH: dict[str, list[TypeHintMatch]] = {
arg_types={
0: "HomeAssistant",
1: "ConfigType",
# 2: "AutomationActionType", # AutomationActionType is deprecated -> TriggerActionType
# 3: "AutomationTriggerInfo", # AutomationTriggerInfo is deprecated -> TriggerInfo
2: "TriggerActionType",
3: "TriggerInfo",
},
return_type="CALLBACK_TYPE",
),

View File

@ -38,6 +38,20 @@ _OBSOLETE_IMPORT: dict[str, list[ObsoleteImportMatch]] = {
constant=re.compile(r"^FORMAT_(\w*)$"),
),
],
"homeassistant.components.automation": [
ObsoleteImportMatch(
reason="replaced by TriggerActionType from helpers.trigger",
constant=re.compile(r"^AutomationActionType$")
),
ObsoleteImportMatch(
reason="replaced by TriggerData from helpers.trigger",
constant=re.compile(r"^AutomationTriggerData$")
),
ObsoleteImportMatch(
reason="replaced by TriggerInfo from helpers.trigger",
constant=re.compile(r"^AutomationTriggerInfo$")
),
],
"homeassistant.components.binary_sensor": [
ObsoleteImportMatch(
reason="replaced by BinarySensorDeviceClass enum",