Bump hatasmota to 0.2.7 (#45625)

This commit is contained in:
Erik Montnemery 2021-01-28 08:55:22 +01:00 committed by GitHub
parent 068d1b5eb8
commit 5711d61b38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 17 deletions

View File

@ -3,7 +3,7 @@
"name": "Tasmota", "name": "Tasmota",
"config_flow": true, "config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/tasmota", "documentation": "https://www.home-assistant.io/integrations/tasmota",
"requirements": ["hatasmota==0.2.6"], "requirements": ["hatasmota==0.2.7"],
"dependencies": ["mqtt"], "dependencies": ["mqtt"],
"mqtt": ["tasmota/discovery/#"], "mqtt": ["tasmota/discovery/#"],
"codeowners": ["@emontnemery"] "codeowners": ["@emontnemery"]

View File

@ -738,7 +738,7 @@ hass-nabucasa==0.41.0
hass_splunk==0.1.1 hass_splunk==0.1.1
# homeassistant.components.tasmota # homeassistant.components.tasmota
hatasmota==0.2.6 hatasmota==0.2.7
# homeassistant.components.jewish_calendar # homeassistant.components.jewish_calendar
hdate==0.9.12 hdate==0.9.12

View File

@ -384,7 +384,7 @@ hangups==0.4.11
hass-nabucasa==0.41.0 hass-nabucasa==0.41.0
# homeassistant.components.tasmota # homeassistant.components.tasmota
hatasmota==0.2.6 hatasmota==0.2.7
# homeassistant.components.jewish_calendar # homeassistant.components.jewish_calendar
hdate==0.9.12 hdate==0.9.12

View File

@ -789,7 +789,7 @@ async def test_sending_mqtt_commands_rgbww(hass, mqtt_mock, setup_tasmota):
# Turn the light on and verify MQTT message is sent # Turn the light on and verify MQTT message is sent
await common.async_turn_on(hass, "light.test") await common.async_turn_on(hass, "light.test")
mqtt_mock.async_publish.assert_called_once_with( mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog", "NoDelay;Fade 0;NoDelay;Power1 ON", 0, False "tasmota_49A3BC/cmnd/Backlog", "NoDelay;Power1 ON", 0, False
) )
mqtt_mock.async_publish.reset_mock() mqtt_mock.async_publish.reset_mock()
@ -800,21 +800,21 @@ async def test_sending_mqtt_commands_rgbww(hass, mqtt_mock, setup_tasmota):
# Turn the light off and verify MQTT message is sent # Turn the light off and verify MQTT message is sent
await common.async_turn_off(hass, "light.test") await common.async_turn_off(hass, "light.test")
mqtt_mock.async_publish.assert_called_once_with( mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog", "NoDelay;Fade 0;NoDelay;Power1 OFF", 0, False "tasmota_49A3BC/cmnd/Backlog", "NoDelay;Power1 OFF", 0, False
) )
mqtt_mock.async_publish.reset_mock() mqtt_mock.async_publish.reset_mock()
# Turn the light on and verify MQTT messages are sent # Turn the light on and verify MQTT messages are sent
await common.async_turn_on(hass, "light.test", brightness=192) await common.async_turn_on(hass, "light.test", brightness=192)
mqtt_mock.async_publish.assert_called_once_with( mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog", "NoDelay;Fade 0;NoDelay;Dimmer 75", 0, False "tasmota_49A3BC/cmnd/Backlog", "NoDelay;Dimmer 75", 0, False
) )
mqtt_mock.async_publish.reset_mock() mqtt_mock.async_publish.reset_mock()
await common.async_turn_on(hass, "light.test", rgb_color=[255, 128, 0]) await common.async_turn_on(hass, "light.test", rgb_color=[255, 128, 0])
mqtt_mock.async_publish.assert_called_once_with( mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog", "tasmota_49A3BC/cmnd/Backlog",
"NoDelay;Fade 0;NoDelay;Power1 ON;NoDelay;Color2 255,128,0", "NoDelay;Power1 ON;NoDelay;Color2 255,128,0",
0, 0,
False, False,
) )
@ -823,7 +823,7 @@ async def test_sending_mqtt_commands_rgbww(hass, mqtt_mock, setup_tasmota):
await common.async_turn_on(hass, "light.test", color_temp=200) await common.async_turn_on(hass, "light.test", color_temp=200)
mqtt_mock.async_publish.assert_called_once_with( mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog", "tasmota_49A3BC/cmnd/Backlog",
"NoDelay;Fade 0;NoDelay;Power1 ON;NoDelay;CT 200", "NoDelay;Power1 ON;NoDelay;CT 200",
0, 0,
False, False,
) )
@ -832,7 +832,7 @@ async def test_sending_mqtt_commands_rgbww(hass, mqtt_mock, setup_tasmota):
await common.async_turn_on(hass, "light.test", white_value=128) await common.async_turn_on(hass, "light.test", white_value=128)
mqtt_mock.async_publish.assert_called_once_with( mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog", "tasmota_49A3BC/cmnd/Backlog",
"NoDelay;Fade 0;NoDelay;Power1 ON;NoDelay;White 50", "NoDelay;Power1 ON;NoDelay;White 50",
0, 0,
False, False,
) )
@ -841,7 +841,7 @@ async def test_sending_mqtt_commands_rgbww(hass, mqtt_mock, setup_tasmota):
await common.async_turn_on(hass, "light.test", effect="Random") await common.async_turn_on(hass, "light.test", effect="Random")
mqtt_mock.async_publish.assert_called_once_with( mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog", "tasmota_49A3BC/cmnd/Backlog",
"NoDelay;Fade 0;NoDelay;Power1 ON;NoDelay;Scheme 4", "NoDelay;Power1 ON;NoDelay;Scheme 4",
0, 0,
False, False,
) )
@ -873,7 +873,7 @@ async def test_sending_mqtt_commands_power_unlinked(hass, mqtt_mock, setup_tasmo
# Turn the light on and verify MQTT message is sent # Turn the light on and verify MQTT message is sent
await common.async_turn_on(hass, "light.test") await common.async_turn_on(hass, "light.test")
mqtt_mock.async_publish.assert_called_once_with( mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog", "NoDelay;Fade 0;NoDelay;Power1 ON", 0, False "tasmota_49A3BC/cmnd/Backlog", "NoDelay;Power1 ON", 0, False
) )
mqtt_mock.async_publish.reset_mock() mqtt_mock.async_publish.reset_mock()
@ -884,7 +884,7 @@ async def test_sending_mqtt_commands_power_unlinked(hass, mqtt_mock, setup_tasmo
# Turn the light off and verify MQTT message is sent # Turn the light off and verify MQTT message is sent
await common.async_turn_off(hass, "light.test") await common.async_turn_off(hass, "light.test")
mqtt_mock.async_publish.assert_called_once_with( mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog", "NoDelay;Fade 0;NoDelay;Power1 OFF", 0, False "tasmota_49A3BC/cmnd/Backlog", "NoDelay;Power1 OFF", 0, False
) )
mqtt_mock.async_publish.reset_mock() mqtt_mock.async_publish.reset_mock()
@ -892,7 +892,7 @@ async def test_sending_mqtt_commands_power_unlinked(hass, mqtt_mock, setup_tasmo
await common.async_turn_on(hass, "light.test", brightness=192) await common.async_turn_on(hass, "light.test", brightness=192)
mqtt_mock.async_publish.assert_called_once_with( mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog", "tasmota_49A3BC/cmnd/Backlog",
"NoDelay;Fade 0;NoDelay;Dimmer 75;NoDelay;Power1 ON", "NoDelay;Dimmer 75;NoDelay;Power1 ON",
0, 0,
False, False,
) )
@ -978,6 +978,24 @@ async def test_transition(hass, mqtt_mock, setup_tasmota):
) )
mqtt_mock.async_publish.reset_mock() mqtt_mock.async_publish.reset_mock()
# Fake state update from the light
async_fire_mqtt_message(
hass, "tasmota_49A3BC/tele/STATE", '{"POWER":"ON","Dimmer":100}'
)
state = hass.states.get("light.test")
assert state.state == STATE_ON
assert state.attributes.get("brightness") == 255
# Dim the light from 100->0: Speed should be 0
await common.async_turn_off(hass, "light.test", transition=0)
mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog",
"NoDelay;Fade 0;NoDelay;Power1 OFF",
0,
False,
)
mqtt_mock.async_publish.reset_mock()
# Fake state update from the light # Fake state update from the light
async_fire_mqtt_message( async_fire_mqtt_message(
hass, hass,
@ -1121,6 +1139,16 @@ async def test_transition_fixed(hass, mqtt_mock, setup_tasmota):
) )
mqtt_mock.async_publish.reset_mock() mqtt_mock.async_publish.reset_mock()
# Dim the light from 0->50: Speed should be 0
await common.async_turn_on(hass, "light.test", brightness=128, transition=0)
mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog",
"NoDelay;Fade 0;NoDelay;Dimmer 50",
0,
False,
)
mqtt_mock.async_publish.reset_mock()
async def test_relay_as_light(hass, mqtt_mock, setup_tasmota): async def test_relay_as_light(hass, mqtt_mock, setup_tasmota):
"""Test relay show up as light in light mode.""" """Test relay show up as light in light mode."""
@ -1167,7 +1195,7 @@ async def _test_split_light(hass, mqtt_mock, config, num_lights, num_switches):
await common.async_turn_on(hass, entity) await common.async_turn_on(hass, entity)
mqtt_mock.async_publish.assert_called_once_with( mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog", "tasmota_49A3BC/cmnd/Backlog",
f"NoDelay;Fade 0;NoDelay;Power{idx+num_switches+1} ON", f"NoDelay;Power{idx+num_switches+1} ON",
0, 0,
False, False,
) )
@ -1177,7 +1205,7 @@ async def _test_split_light(hass, mqtt_mock, config, num_lights, num_switches):
await common.async_turn_on(hass, entity, brightness=(idx + 1) * 25.5) await common.async_turn_on(hass, entity, brightness=(idx + 1) * 25.5)
mqtt_mock.async_publish.assert_called_once_with( mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog", "tasmota_49A3BC/cmnd/Backlog",
f"NoDelay;Fade 0;NoDelay;Channel{idx+num_switches+1} {(idx+1)*10}", f"NoDelay;Channel{idx+num_switches+1} {(idx+1)*10}",
0, 0,
False, False,
) )
@ -1239,7 +1267,7 @@ async def _test_unlinked_light(hass, mqtt_mock, config, num_switches):
await common.async_turn_on(hass, entity) await common.async_turn_on(hass, entity)
mqtt_mock.async_publish.assert_called_once_with( mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog", "tasmota_49A3BC/cmnd/Backlog",
f"NoDelay;Fade 0;NoDelay;Power{idx+num_switches+1} ON", f"NoDelay;Power{idx+num_switches+1} ON",
0, 0,
False, False,
) )
@ -1249,7 +1277,7 @@ async def _test_unlinked_light(hass, mqtt_mock, config, num_switches):
await common.async_turn_on(hass, entity, brightness=(idx + 1) * 25.5) await common.async_turn_on(hass, entity, brightness=(idx + 1) * 25.5)
mqtt_mock.async_publish.assert_called_once_with( mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog", "tasmota_49A3BC/cmnd/Backlog",
f"NoDelay;Fade 0;NoDelay;Dimmer{idx+1} {(idx+1)*10}", f"NoDelay;Dimmer{idx+1} {(idx+1)*10}",
0, 0,
False, False,
) )