Bump hatasmota to 0.3.1 (#61120)

This commit is contained in:
Erik Montnemery 2021-12-07 08:07:31 +01:00 committed by GitHub
parent 009a28ba7a
commit 5161126b58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 33 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.3.0"],
"requirements": ["hatasmota==0.3.1"],
"dependencies": ["mqtt"],
"mqtt": ["tasmota/discovery/#"],
"codeowners": ["@emontnemery"],

View file

@ -795,7 +795,7 @@ hass-nabucasa==0.50.0
hass_splunk==0.1.1
# homeassistant.components.tasmota
hatasmota==0.3.0
hatasmota==0.3.1
# homeassistant.components.jewish_calendar
hdate==0.10.4

View file

@ -500,7 +500,7 @@ hangups==0.4.14
hass-nabucasa==0.50.0
# homeassistant.components.tasmota
hatasmota==0.3.0
hatasmota==0.3.1
# homeassistant.components.jewish_calendar
hdate==0.10.4

View file

@ -9,6 +9,7 @@ from hatasmota.utils import (
get_topic_tele_sensor,
get_topic_tele_will,
)
import pytest
from homeassistant.components import cover
from homeassistant.components.tasmota.const import DEFAULT_PREFIX
@ -34,6 +35,35 @@ async def test_missing_relay(hass, mqtt_mock, setup_tasmota):
"""Test no cover is discovered if relays are missing."""
@pytest.mark.parametrize(
"relay_config, num_covers",
[
([3, 3, 3, 3, 3, 3, 1, 1, 3, 3], 4),
([3, 3, 3, 3, 0, 0, 0, 0], 2),
([3, 3, 1, 1, 0, 0, 0, 0], 1),
([3, 3, 3, 1, 0, 0, 0, 0], 0),
],
)
async def test_multiple_covers(
hass, mqtt_mock, setup_tasmota, relay_config, num_covers
):
"""Test discovery of multiple covers."""
config = copy.deepcopy(DEFAULT_CONFIG)
config["rl"] = relay_config
mac = config["mac"]
assert len(hass.states.async_all("cover")) == 0
async_fire_mqtt_message(
hass,
f"{DEFAULT_PREFIX}/{mac}/config",
json.dumps(config),
)
await hass.async_block_till_done()
assert len(hass.states.async_all("cover")) == num_covers
async def test_controlling_state_via_mqtt(hass, mqtt_mock, setup_tasmota):
"""Test state update via MQTT."""
config = copy.deepcopy(DEFAULT_CONFIG)