mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Bump hatasmota to 0.7.2 (#100129)
This commit is contained in:
parent
56678851af
commit
18e08bc79f
@ -8,5 +8,5 @@
|
||||
"iot_class": "local_push",
|
||||
"loggers": ["hatasmota"],
|
||||
"mqtt": ["tasmota/discovery/#"],
|
||||
"requirements": ["HATasmota==0.7.1"]
|
||||
"requirements": ["HATasmota==0.7.2"]
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ DoorBirdPy==2.1.0
|
||||
HAP-python==4.7.1
|
||||
|
||||
# homeassistant.components.tasmota
|
||||
HATasmota==0.7.1
|
||||
HATasmota==0.7.2
|
||||
|
||||
# homeassistant.components.mastodon
|
||||
Mastodon.py==1.5.1
|
||||
|
@ -28,7 +28,7 @@ DoorBirdPy==2.1.0
|
||||
HAP-python==4.7.1
|
||||
|
||||
# homeassistant.components.tasmota
|
||||
HATasmota==0.7.1
|
||||
HATasmota==0.7.2
|
||||
|
||||
# homeassistant.components.doods
|
||||
# homeassistant.components.generic
|
||||
|
@ -1835,3 +1835,35 @@ async def test_entity_id_update_discovery_update(
|
||||
await help_test_entity_id_update_discovery_update(
|
||||
hass, mqtt_mock, Platform.LIGHT, config
|
||||
)
|
||||
|
||||
|
||||
async def test_no_device_name(
|
||||
hass: HomeAssistant, mqtt_mock: MqttMockHAClient, setup_tasmota
|
||||
) -> None:
|
||||
"""Test name of lights when no device name is set.
|
||||
|
||||
When the device name is not set, Tasmota uses friendly name 1 as device naem.
|
||||
This test ensures that case is handled correctly.
|
||||
"""
|
||||
config = copy.deepcopy(DEFAULT_CONFIG)
|
||||
config["dn"] = "Light 1"
|
||||
config["fn"][0] = "Light 1"
|
||||
config["fn"][1] = "Light 2"
|
||||
config["rl"][0] = 2
|
||||
config["rl"][1] = 2
|
||||
mac = config["mac"]
|
||||
|
||||
async_fire_mqtt_message(
|
||||
hass,
|
||||
f"{DEFAULT_PREFIX}/{mac}/config",
|
||||
json.dumps(config),
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
state = hass.states.get("light.light_1")
|
||||
assert state is not None
|
||||
assert state.attributes["friendly_name"] == "Light 1"
|
||||
|
||||
state = hass.states.get("light.light_1_light_2")
|
||||
assert state is not None
|
||||
assert state.attributes["friendly_name"] == "Light 1 Light 2"
|
||||
|
@ -283,3 +283,35 @@ async def test_entity_id_update_discovery_update(
|
||||
await help_test_entity_id_update_discovery_update(
|
||||
hass, mqtt_mock, Platform.SWITCH, config
|
||||
)
|
||||
|
||||
|
||||
async def test_no_device_name(
|
||||
hass: HomeAssistant, mqtt_mock: MqttMockHAClient, setup_tasmota
|
||||
) -> None:
|
||||
"""Test name of switches when no device name is set.
|
||||
|
||||
When the device name is not set, Tasmota uses friendly name 1 as device naem.
|
||||
This test ensures that case is handled correctly.
|
||||
"""
|
||||
config = copy.deepcopy(DEFAULT_CONFIG)
|
||||
config["dn"] = "Relay 1"
|
||||
config["fn"][0] = "Relay 1"
|
||||
config["fn"][1] = "Relay 2"
|
||||
config["rl"][0] = 1
|
||||
config["rl"][1] = 1
|
||||
mac = config["mac"]
|
||||
|
||||
async_fire_mqtt_message(
|
||||
hass,
|
||||
f"{DEFAULT_PREFIX}/{mac}/config",
|
||||
json.dumps(config),
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
state = hass.states.get("switch.relay_1")
|
||||
assert state is not None
|
||||
assert state.attributes["friendly_name"] == "Relay 1"
|
||||
|
||||
state = hass.states.get("switch.relay_1_relay_2")
|
||||
assert state is not None
|
||||
assert state.attributes["friendly_name"] == "Relay 1 Relay 2"
|
||||
|
Loading…
x
Reference in New Issue
Block a user