mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Fix invalid tuple annotations (#116035)
This commit is contained in:
parent
d367bc63f0
commit
a0314cddd4
@ -125,13 +125,13 @@ class ImapMessage:
|
|||||||
return str(part.get_payload())
|
return str(part.get_payload())
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def headers(self) -> dict[str, tuple[str,]]:
|
def headers(self) -> dict[str, tuple[str, ...]]:
|
||||||
"""Get the email headers."""
|
"""Get the email headers."""
|
||||||
header_base: dict[str, tuple[str,]] = {}
|
header_base: dict[str, tuple[str, ...]] = {}
|
||||||
for key, value in self.email_message.items():
|
for key, value in self.email_message.items():
|
||||||
header_instances: tuple[str,] = (str(value),)
|
header_instances: tuple[str, ...] = (str(value),)
|
||||||
if header_base.setdefault(key, header_instances) != header_instances:
|
if header_base.setdefault(key, header_instances) != header_instances:
|
||||||
header_base[key] += header_instances # type: ignore[assignment]
|
header_base[key] += header_instances
|
||||||
return header_base
|
return header_base
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -663,9 +663,9 @@ async def test_is_on(hass: HomeAssistant) -> None:
|
|||||||
)
|
)
|
||||||
async def test_is_on_and_state_mixed_domains(
|
async def test_is_on_and_state_mixed_domains(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
domains: tuple[str,],
|
domains: tuple[str, ...],
|
||||||
states_old: tuple[str,],
|
states_old: tuple[str, ...],
|
||||||
states_new: tuple[str,],
|
states_new: tuple[str, ...],
|
||||||
state_ison_group_old: tuple[str, bool],
|
state_ison_group_old: tuple[str, bool],
|
||||||
state_ison_group_new: tuple[str, bool],
|
state_ison_group_new: tuple[str, bool],
|
||||||
) -> None:
|
) -> None:
|
||||||
|
@ -83,7 +83,7 @@ def help_all_subscribe_calls(mqtt_client_mock: MqttMockPahoClient) -> list[Any]:
|
|||||||
def help_custom_config(
|
def help_custom_config(
|
||||||
mqtt_entity_domain: str,
|
mqtt_entity_domain: str,
|
||||||
mqtt_base_config: ConfigType,
|
mqtt_base_config: ConfigType,
|
||||||
mqtt_entity_configs: Iterable[ConfigType,],
|
mqtt_entity_configs: Iterable[ConfigType],
|
||||||
) -> ConfigType:
|
) -> ConfigType:
|
||||||
"""Tweak a default config for parametrization.
|
"""Tweak a default config for parametrization.
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ async def test_warning_if_color_mode_flags_are_used(
|
|||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mqtt_mock_entry: MqttMockHAClientGenerator,
|
mqtt_mock_entry: MqttMockHAClientGenerator,
|
||||||
caplog: pytest.LogCaptureFixture,
|
caplog: pytest.LogCaptureFixture,
|
||||||
color_modes: tuple[str,],
|
color_modes: tuple[str, ...],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test warnings deprecated config keys without supported color modes defined."""
|
"""Test warnings deprecated config keys without supported color modes defined."""
|
||||||
with patch(
|
with patch(
|
||||||
@ -278,7 +278,7 @@ async def test_warning_on_discovery_if_color_mode_flags_are_used(
|
|||||||
mqtt_mock_entry: MqttMockHAClientGenerator,
|
mqtt_mock_entry: MqttMockHAClientGenerator,
|
||||||
caplog: pytest.LogCaptureFixture,
|
caplog: pytest.LogCaptureFixture,
|
||||||
config: dict[str, Any],
|
config: dict[str, Any],
|
||||||
color_modes: tuple[str,],
|
color_modes: tuple[str, ...],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test warnings deprecated config keys with discovery."""
|
"""Test warnings deprecated config keys with discovery."""
|
||||||
with patch(
|
with patch(
|
||||||
|
@ -102,7 +102,7 @@ def test_template_message(arg: str | Exception, expected: str) -> None:
|
|||||||
)
|
)
|
||||||
async def test_home_assistant_error(
|
async def test_home_assistant_error(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
exception_args: tuple[Any,],
|
exception_args: tuple[Any, ...],
|
||||||
exception_kwargs: dict[str, Any],
|
exception_kwargs: dict[str, Any],
|
||||||
args_base_class: tuple[Any],
|
args_base_class: tuple[Any],
|
||||||
message: str,
|
message: str,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user