Correct type hints on MQTT tests (#128299)

This commit is contained in:
Jan Bouwhuis
2024-10-16 13:49:18 +02:00
committed by GitHub
parent 9f2bdca9ad
commit ac6d893758
23 changed files with 127 additions and 120 deletions

View File

@@ -1486,7 +1486,7 @@ async def test_encoding_subscribable_topics(
attribute_value: Any,
) -> None:
"""Test handling of incoming encoded payload."""
config = copy.deepcopy(DEFAULT_CONFIG[mqtt.DOMAIN][fan.DOMAIN])
config: dict[str, Any] = copy.deepcopy(DEFAULT_CONFIG[mqtt.DOMAIN][fan.DOMAIN])
config[ATTR_PRESET_MODES] = ["eco", "auto"]
config[CONF_PRESET_MODE_COMMAND_TOPIC] = "fan/some_preset_mode_command_topic"
config[CONF_PERCENTAGE_COMMAND_TOPIC] = "fan/some_percentage_command_topic"
@@ -2201,7 +2201,7 @@ async def test_publishing_with_custom_encoding(
) -> None:
"""Test publishing MQTT payload with different encoding."""
domain = fan.DOMAIN
config = copy.deepcopy(DEFAULT_CONFIG)
config: dict[str, Any] = copy.deepcopy(DEFAULT_CONFIG)
if topic == "preset_mode_command_topic":
config[mqtt.DOMAIN][domain]["preset_modes"] = ["auto", "eco"]