mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Enforce type hints for backup and cast platforms (#72223)
* Enforce backup type hints * Enforce cast type hints
This commit is contained in:
parent
dc0d065901
commit
d40cd20692
@ -46,6 +46,10 @@ _MODULE_FILTERS: dict[str, re.Pattern] = {
|
||||
"application_credentials": re.compile(
|
||||
r"^homeassistant\.components\.\w+\.(application_credentials)$"
|
||||
),
|
||||
# backup matches only in the package root (backup.py)
|
||||
"backup": re.compile(r"^homeassistant\.components\.\w+\.(backup)$"),
|
||||
# cast matches only in the package root (cast.py)
|
||||
"cast": re.compile(r"^homeassistant\.components\.\w+\.(cast)$"),
|
||||
# config_flow matches only in the package root (config_flow.py)
|
||||
"config_flow": re.compile(r"^homeassistant\.components\.\w+\.(config_flow)$"),
|
||||
# device_action matches only in the package root (device_action.py)
|
||||
@ -167,6 +171,54 @@ _METHOD_MATCH: list[TypeHintMatch] = [
|
||||
},
|
||||
return_type="AuthorizationServer",
|
||||
),
|
||||
TypeHintMatch(
|
||||
module_filter=_MODULE_FILTERS["backup"],
|
||||
function_name="async_pre_backup",
|
||||
arg_types={
|
||||
0: "HomeAssistant",
|
||||
},
|
||||
return_type=None,
|
||||
),
|
||||
TypeHintMatch(
|
||||
module_filter=_MODULE_FILTERS["backup"],
|
||||
function_name="async_post_backup",
|
||||
arg_types={
|
||||
0: "HomeAssistant",
|
||||
},
|
||||
return_type=None,
|
||||
),
|
||||
TypeHintMatch(
|
||||
module_filter=_MODULE_FILTERS["cast"],
|
||||
function_name="async_get_media_browser_root_object",
|
||||
arg_types={
|
||||
0: "HomeAssistant",
|
||||
1: "str",
|
||||
},
|
||||
return_type="list[BrowseMedia]",
|
||||
),
|
||||
TypeHintMatch(
|
||||
module_filter=_MODULE_FILTERS["cast"],
|
||||
function_name="async_browse_media",
|
||||
arg_types={
|
||||
0: "HomeAssistant",
|
||||
1: "str",
|
||||
2: "str",
|
||||
3: "str",
|
||||
},
|
||||
return_type=["BrowseMedia", "BrowseMedia | None"],
|
||||
),
|
||||
TypeHintMatch(
|
||||
module_filter=_MODULE_FILTERS["cast"],
|
||||
function_name="async_play_media",
|
||||
arg_types={
|
||||
0: "HomeAssistant",
|
||||
1: "str",
|
||||
2: "Chromecast",
|
||||
3: "str",
|
||||
4: "str",
|
||||
},
|
||||
return_type="bool",
|
||||
),
|
||||
TypeHintMatch(
|
||||
module_filter=_MODULE_FILTERS["config_flow"],
|
||||
function_name="_async_has_devices",
|
||||
|
Loading…
x
Reference in New Issue
Block a user