Bump hatasmota to 0.2.5 (#45297)

This commit is contained in:
Erik Montnemery 2021-01-18 22:26:33 +01:00 committed by GitHub
parent 94dbcc9d2b
commit 852136ccfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 66 additions and 3 deletions

View File

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

View File

@ -735,7 +735,7 @@ hass-nabucasa==0.39.0
hass_splunk==0.1.1
# homeassistant.components.tasmota
hatasmota==0.1.6
hatasmota==0.2.5
# homeassistant.components.jewish_calendar
hdate==0.9.12

View File

@ -376,7 +376,7 @@ hangups==0.4.11
hass-nabucasa==0.39.0
# homeassistant.components.tasmota
hatasmota==0.1.6
hatasmota==0.2.5
# homeassistant.components.jewish_calendar
hdate==0.9.12

View File

@ -1059,6 +1059,69 @@ async def test_transition(hass, mqtt_mock, setup_tasmota):
mqtt_mock.async_publish.reset_mock()
async def test_transition_fixed(hass, mqtt_mock, setup_tasmota):
"""Test transition commands."""
config = copy.deepcopy(DEFAULT_CONFIG)
config["rl"][0] = 2
config["lt_st"] = 5 # 5 channel light (RGBCW)
config["so"]["117"] = 1 # fading at fixed duration instead of fixed slew rate
mac = config["mac"]
async_fire_mqtt_message(
hass,
f"{DEFAULT_PREFIX}/{mac}/config",
json.dumps(config),
)
await hass.async_block_till_done()
async_fire_mqtt_message(hass, "tasmota_49A3BC/tele/LWT", "Online")
state = hass.states.get("light.test")
assert state.state == STATE_OFF
await hass.async_block_till_done()
await hass.async_block_till_done()
mqtt_mock.async_publish.reset_mock()
# Dim the light from 0->100: Speed should be 4*2=8
await common.async_turn_on(hass, "light.test", brightness=255, transition=4)
mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog",
"NoDelay;Fade 1;NoDelay;Speed 8;NoDelay;Dimmer 100",
0,
False,
)
mqtt_mock.async_publish.reset_mock()
# Dim the light from 0->100: Speed should be capped at 40
await common.async_turn_on(hass, "light.test", brightness=255, transition=100)
mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog",
"NoDelay;Fade 1;NoDelay;Speed 40;NoDelay;Dimmer 100",
0,
False,
)
mqtt_mock.async_publish.reset_mock()
# Dim the light from 0->0: Speed should be 4*2=8
await common.async_turn_on(hass, "light.test", brightness=0, transition=4)
mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog",
"NoDelay;Fade 1;NoDelay;Speed 8;NoDelay;Power1 OFF",
0,
False,
)
mqtt_mock.async_publish.reset_mock()
# Dim the light from 0->50: Speed should be 4*2=8
await common.async_turn_on(hass, "light.test", brightness=128, transition=4)
mqtt_mock.async_publish.assert_called_once_with(
"tasmota_49A3BC/cmnd/Backlog",
"NoDelay;Fade 1;NoDelay;Speed 8;NoDelay;Dimmer 50",
0,
False,
)
mqtt_mock.async_publish.reset_mock()
async def test_relay_as_light(hass, mqtt_mock, setup_tasmota):
"""Test relay show up as light in light mode."""
config = copy.deepcopy(DEFAULT_CONFIG)