diff --git a/homeassistant/components/sonos/favorites.py b/homeassistant/components/sonos/favorites.py index f8b3dbbe492..8824c56a762 100644 --- a/homeassistant/components/sonos/favorites.py +++ b/homeassistant/components/sonos/favorites.py @@ -75,7 +75,7 @@ class SonosFavorites(SonosHouseholdCoordinator): if not (match := re.search(r"FV:2,(\d+)", container_ids)): return - container_id = int(match.groups()[0]) + container_id = int(match.group(1)) event_id = int(event_id.split(",")[-1]) async with self.cache_update_lock: diff --git a/pylint/plugins/hass_enforce_type_hints.py b/pylint/plugins/hass_enforce_type_hints.py index 32a053527f6..82118209e65 100644 --- a/pylint/plugins/hass_enforce_type_hints.py +++ b/pylint/plugins/hass_enforce_type_hints.py @@ -3241,7 +3241,7 @@ def _get_module_platform(module_name: str) -> str | None: # Or `homeassistant.components..` return None - platform = module_match.groups()[0] + platform = module_match.group(1) return platform.lstrip(".") if platform else "__init__" diff --git a/pylint/plugins/hass_inheritance.py b/pylint/plugins/hass_inheritance.py index e386986fa23..cc2a40d4a4a 100644 --- a/pylint/plugins/hass_inheritance.py +++ b/pylint/plugins/hass_inheritance.py @@ -18,7 +18,7 @@ def _get_module_platform(module_name: str) -> str | None: # Or `homeassistant.components..` return None - platform = module_match.groups()[0] + platform = module_match.group(1) return platform.lstrip(".") if platform else "__init__" diff --git a/script/hassfest/translations.py b/script/hassfest/translations.py index 913f7df2e7a..93fd212b981 100644 --- a/script/hassfest/translations.py +++ b/script/hassfest/translations.py @@ -98,7 +98,7 @@ def find_references( continue if match := re.match(RE_REFERENCE, value): - found.append({"source": f"{prefix}::{key}", "ref": match.groups()[0]}) + found.append({"source": f"{prefix}::{key}", "ref": match.group(1)}) def removed_title_validator( @@ -570,7 +570,7 @@ def validate_translation_file( "translations", "Lokalise supports only one level of references: " f'"{reference["source"]}" should point to directly ' - f'to "{match.groups()[0]}"', + f'to "{match.group(1)}"', )