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:
@@ -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__"
|
||||
|
||||
|
||||
|
||||
@@ -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__"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user