1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Fix supported_features in mqtt cover (#28120)

* Correctly compute the supported_features in cover.mqtt

* Update homeassistant/components/mqtt/cover.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Correctly compute the supported_features in cover.mqtt

* Format
This commit is contained in:
Adrien Foulon
2019-10-23 19:44:47 +02:00
committed by Paulus Schoutsen
parent b8d2c58c60
commit 85eefe41da
2 changed files with 28 additions and 2 deletions

View File

@@ -546,6 +546,27 @@ async def test_no_command_topic(hass, mqtt_mock):
assert hass.states.get("cover.test").attributes["supported_features"] == 240
async def test_no_payload_stop(hass, mqtt_mock):
"""Test with no stop payload."""
assert await async_setup_component(
hass,
cover.DOMAIN,
{
cover.DOMAIN: {
"platform": "mqtt",
"name": "test",
"command_topic": "command-topic",
"qos": 0,
"payload_open": "OPEN",
"payload_close": "CLOSE",
"payload_stop": None,
}
},
)
assert hass.states.get("cover.test").attributes["supported_features"] == 3
async def test_with_command_topic_and_tilt(hass, mqtt_mock):
"""Test with command topic and tilt config."""
assert await async_setup_component(