diff --git a/homeassistant/components/google_cloud/helpers.py b/homeassistant/components/google_cloud/helpers.py index 97fa66b1f181b492e32c573e2d31b4bc028f5eb5..66dfbcf01eb9b39b8e0fe4ecbcfad0335cc2d817 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 5b41ca17a5775d0594b1339cdd6d28f240b0733d..7c79cf7b5a5ddd4a1d88b4171b01285698d7f536 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