Bump hatasmota to 0.0.23 (#42394)
This commit is contained in:
parent
1fb18580b2
commit
c00ab762d3
5 changed files with 56 additions and 5 deletions
|
@ -3,7 +3,7 @@
|
||||||
"name": "Tasmota (beta)",
|
"name": "Tasmota (beta)",
|
||||||
"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.0.22"],
|
"requirements": ["hatasmota==0.0.23"],
|
||||||
"dependencies": ["mqtt"],
|
"dependencies": ["mqtt"],
|
||||||
"mqtt": ["tasmota/discovery/#"],
|
"mqtt": ["tasmota/discovery/#"],
|
||||||
"codeowners": ["@emontnemery"]
|
"codeowners": ["@emontnemery"]
|
||||||
|
|
|
@ -732,7 +732,7 @@ hass-nabucasa==0.37.1
|
||||||
hass_splunk==0.1.1
|
hass_splunk==0.1.1
|
||||||
|
|
||||||
# homeassistant.components.tasmota
|
# homeassistant.components.tasmota
|
||||||
hatasmota==0.0.22
|
hatasmota==0.0.23
|
||||||
|
|
||||||
# homeassistant.components.jewish_calendar
|
# homeassistant.components.jewish_calendar
|
||||||
hdate==0.9.5
|
hdate==0.9.5
|
||||||
|
|
|
@ -367,7 +367,7 @@ hangups==0.4.11
|
||||||
hass-nabucasa==0.37.1
|
hass-nabucasa==0.37.1
|
||||||
|
|
||||||
# homeassistant.components.tasmota
|
# homeassistant.components.tasmota
|
||||||
hatasmota==0.0.22
|
hatasmota==0.0.23
|
||||||
|
|
||||||
# homeassistant.components.jewish_calendar
|
# homeassistant.components.jewish_calendar
|
||||||
hdate==0.9.5
|
hdate==0.9.5
|
||||||
|
|
|
@ -3,6 +3,11 @@ import copy
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from hatasmota.const import CONF_MAC
|
from hatasmota.const import CONF_MAC
|
||||||
|
from hatasmota.utils import (
|
||||||
|
get_topic_stat_result,
|
||||||
|
get_topic_tele_state,
|
||||||
|
get_topic_tele_will,
|
||||||
|
)
|
||||||
|
|
||||||
from homeassistant.components import light
|
from homeassistant.components import light
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
|
@ -310,6 +315,16 @@ async def test_controlling_state_via_mqtt_on_off(hass, mqtt_mock, setup_tasmota)
|
||||||
state = hass.states.get("light.test")
|
state = hass.states.get("light.test")
|
||||||
assert state.state == STATE_OFF
|
assert state.state == STATE_OFF
|
||||||
|
|
||||||
|
async_fire_mqtt_message(hass, "tasmota_49A3BC/stat/RESULT", '{"POWER":"ON"}')
|
||||||
|
|
||||||
|
state = hass.states.get("light.test")
|
||||||
|
assert state.state == STATE_ON
|
||||||
|
|
||||||
|
async_fire_mqtt_message(hass, "tasmota_49A3BC/stat/RESULT", '{"POWER":"OFF"}')
|
||||||
|
|
||||||
|
state = hass.states.get("light.test")
|
||||||
|
assert state.state == STATE_OFF
|
||||||
|
|
||||||
|
|
||||||
async def test_controlling_state_via_mqtt_ct(hass, mqtt_mock, setup_tasmota):
|
async def test_controlling_state_via_mqtt_ct(hass, mqtt_mock, setup_tasmota):
|
||||||
"""Test state update via MQTT."""
|
"""Test state update via MQTT."""
|
||||||
|
@ -432,6 +447,16 @@ async def test_controlling_state_via_mqtt_rgbww(hass, mqtt_mock, setup_tasmota):
|
||||||
assert state.state == STATE_ON
|
assert state.state == STATE_ON
|
||||||
assert state.attributes.get("effect") == "Cycle down"
|
assert state.attributes.get("effect") == "Cycle down"
|
||||||
|
|
||||||
|
async_fire_mqtt_message(hass, "tasmota_49A3BC/stat/RESULT", '{"POWER":"ON"}')
|
||||||
|
|
||||||
|
state = hass.states.get("light.test")
|
||||||
|
assert state.state == STATE_ON
|
||||||
|
|
||||||
|
async_fire_mqtt_message(hass, "tasmota_49A3BC/stat/RESULT", '{"POWER":"OFF"}')
|
||||||
|
|
||||||
|
state = hass.states.get("light.test")
|
||||||
|
assert state.state == STATE_OFF
|
||||||
|
|
||||||
|
|
||||||
async def test_sending_mqtt_commands_on_off(hass, mqtt_mock, setup_tasmota):
|
async def test_sending_mqtt_commands_on_off(hass, mqtt_mock, setup_tasmota):
|
||||||
"""Test the sending MQTT commands."""
|
"""Test the sending MQTT commands."""
|
||||||
|
@ -914,8 +939,13 @@ async def test_entity_id_update_subscriptions(hass, mqtt_mock, setup_tasmota):
|
||||||
config = copy.deepcopy(DEFAULT_CONFIG)
|
config = copy.deepcopy(DEFAULT_CONFIG)
|
||||||
config["rl"][0] = 2
|
config["rl"][0] = 2
|
||||||
config["lt_st"] = 1 # 1 channel light (Dimmer)
|
config["lt_st"] = 1 # 1 channel light (Dimmer)
|
||||||
|
topics = [
|
||||||
|
get_topic_stat_result(config),
|
||||||
|
get_topic_tele_state(config),
|
||||||
|
get_topic_tele_will(config),
|
||||||
|
]
|
||||||
await help_test_entity_id_update_subscriptions(
|
await help_test_entity_id_update_subscriptions(
|
||||||
hass, mqtt_mock, light.DOMAIN, config
|
hass, mqtt_mock, light.DOMAIN, config, topics
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,12 @@
|
||||||
import copy
|
import copy
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
from hatasmota.utils import (
|
||||||
|
get_topic_stat_result,
|
||||||
|
get_topic_tele_state,
|
||||||
|
get_topic_tele_will,
|
||||||
|
)
|
||||||
|
|
||||||
from homeassistant.components import switch
|
from homeassistant.components import switch
|
||||||
from homeassistant.components.tasmota.const import DEFAULT_PREFIX
|
from homeassistant.components.tasmota.const import DEFAULT_PREFIX
|
||||||
from homeassistant.const import ATTR_ASSUMED_STATE, STATE_OFF, STATE_ON
|
from homeassistant.const import ATTR_ASSUMED_STATE, STATE_OFF, STATE_ON
|
||||||
|
@ -56,6 +62,16 @@ async def test_controlling_state_via_mqtt(hass, mqtt_mock, setup_tasmota):
|
||||||
state = hass.states.get("switch.test")
|
state = hass.states.get("switch.test")
|
||||||
assert state.state == STATE_OFF
|
assert state.state == STATE_OFF
|
||||||
|
|
||||||
|
async_fire_mqtt_message(hass, "tasmota_49A3BC/stat/RESULT", '{"POWER":"ON"}')
|
||||||
|
|
||||||
|
state = hass.states.get("switch.test")
|
||||||
|
assert state.state == STATE_ON
|
||||||
|
|
||||||
|
async_fire_mqtt_message(hass, "tasmota_49A3BC/stat/RESULT", '{"POWER":"OFF"}')
|
||||||
|
|
||||||
|
state = hass.states.get("switch.test")
|
||||||
|
assert state.state == STATE_OFF
|
||||||
|
|
||||||
|
|
||||||
async def test_sending_mqtt_commands(hass, mqtt_mock, setup_tasmota):
|
async def test_sending_mqtt_commands(hass, mqtt_mock, setup_tasmota):
|
||||||
"""Test the sending MQTT commands."""
|
"""Test the sending MQTT commands."""
|
||||||
|
@ -211,8 +227,13 @@ async def test_entity_id_update_subscriptions(hass, mqtt_mock, setup_tasmota):
|
||||||
"""Test MQTT subscriptions are managed when entity_id is updated."""
|
"""Test MQTT subscriptions are managed when entity_id is updated."""
|
||||||
config = copy.deepcopy(DEFAULT_CONFIG)
|
config = copy.deepcopy(DEFAULT_CONFIG)
|
||||||
config["rl"][0] = 1
|
config["rl"][0] = 1
|
||||||
|
topics = [
|
||||||
|
get_topic_stat_result(config),
|
||||||
|
get_topic_tele_state(config),
|
||||||
|
get_topic_tele_will(config),
|
||||||
|
]
|
||||||
await help_test_entity_id_update_subscriptions(
|
await help_test_entity_id_update_subscriptions(
|
||||||
hass, mqtt_mock, switch.DOMAIN, config
|
hass, mqtt_mock, switch.DOMAIN, config, topics
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue