diff --git a/homeassistant/components/google_cloud/helpers.py b/homeassistant/components/google_cloud/helpers.py index 97fa66b1f18..66dfbcf01eb 100644 --- a/homeassistant/components/google_cloud/helpers.py +++ b/homeassistant/components/google_cloud/helpers.py @@ -2,6 +2,8 @@ from __future__ import annotations +import functools +import operator from types import MappingProxyType from typing import Any @@ -74,7 +76,7 @@ def tts_options_schema( ): SelectSelector( SelectSelectorConfig( mode=SelectSelectorMode.DROPDOWN, - options=["", *sum(voices.values(), [])], + options=["", *functools.reduce(operator.iadd, voices.values(), [])], ) ), vol.Optional( diff --git a/pyproject.toml b/pyproject.toml index 5b41ca17a57..7c79cf7b5a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -746,6 +746,7 @@ select = [ "RUF006", # Store a reference to the return value of asyncio.create_task "RUF010", # Use explicit conversion flag "RUF013", # PEP 484 prohibits implicit Optional + "RUF017", # Avoid quadratic list summation "RUF018", # Avoid assignment expressions in assert statements "RUF019", # Unnecessary key check before dictionary access # "RUF100", # Unused `noqa` directive; temporarily every now and then to clean them up