diff --git a/homeassistant/components/tasmota/manifest.json b/homeassistant/components/tasmota/manifest.json index 9ea06bea545..bd30231396f 100644 --- a/homeassistant/components/tasmota/manifest.json +++ b/homeassistant/components/tasmota/manifest.json @@ -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"], diff --git a/requirements_all.txt b/requirements_all.txt index 27be10465e7..dcf44749cdb 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -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 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index a62a75382a1..6677487dd3b 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -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 diff --git a/tests/components/tasmota/test_cover.py b/tests/components/tasmota/test_cover.py index 54ac192f7c1..c036f490f6d 100644 --- a/tests/components/tasmota/test_cover.py +++ b/tests/components/tasmota/test_cover.py @@ -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)