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:
1 parent
b8d2c58c60
commit
85eefe41da
2 files changed
+28
-2
No files matched your search
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user