1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Simplify unnecessary re match.groups()[0] calls (#147909)

This commit is contained in:
Ville Skyttä
2025-07-02 12:12:26 +00:00
committed by GitHub
parent f10fcde6d8
commit ff76017ba6
4 changed files with 5 additions and 5 deletions

View File

@@ -3241,7 +3241,7 @@ def _get_module_platform(module_name: str) -> str | None:
# Or `homeassistant.components.<component>.<platform>`
return None
platform = module_match.groups()[0]
platform = module_match.group(1)
return platform.lstrip(".") if platform else "__init__"

View File

@@ -18,7 +18,7 @@ def _get_module_platform(module_name: str) -> str | None:
# Or `homeassistant.components.<component>.<platform>`
return None
platform = module_match.groups()[0]
platform = module_match.group(1)
return platform.lstrip(".") if platform else "__init__"