Update pylint plugin to validate _async_has_devices (#66512)

This commit is contained in:
Marc Mueller 2022-02-14 18:10:50 +01:00 committed by GitHub
parent 8456c6416e
commit ab67ba20f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 28 additions and 10 deletions

View file

@ -44,6 +44,8 @@ _MODULE_FILTERS: dict[str, re.Pattern] = {
"device_tracker": re.compile(r"^homeassistant\.components\.\w+\.(device_tracker)$"),
# diagnostics matches only in the package root (diagnostics.py)
"diagnostics": re.compile(r"^homeassistant\.components\.\w+\.(diagnostics)$"),
# config_flow matches only in the package root (config_flow.py)
"config_flow": re.compile(r"^homeassistant\.components\.\w+\.(config_flow)$")
}
_METHOD_MATCH: list[TypeHintMatch] = [
@ -192,6 +194,14 @@ _METHOD_MATCH: list[TypeHintMatch] = [
},
return_type=UNDEFINED,
),
TypeHintMatch(
module_filter=_MODULE_FILTERS["config_flow"],
function_name="_async_has_devices",
arg_types={
0: "HomeAssistant",
},
return_type="bool",
),
]