Add supported_features to the MQTT Alarm Control Panel (#28599)

* Add supported_features to the MQTT Alarm Control Panel

Add documentation for the new "supported_features" option. See
home-assistant/core#98363.

* Apply suggestions from code review

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

* Add an example for MQTT Alarm Control Panel's supported_features

* Use a block rather than a flow sequence in the supported_features example

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

---------

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
This commit is contained in:
Faidon Liambotis 2023-08-18 10:33:41 +03:00 committed by GitHub
parent 442448a9ac
commit 4efe0a784b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -244,6 +244,11 @@ state_topic:
description: The MQTT topic subscribed to receive state updates.
required: true
type: string
supported_features:
description: A list of features that the alarm control panel supports. The available list options are `arm_home`, `arm_away`, `arm_night`, `arm_vacation`, `arm_custom_bypass`, and `trigger`.
required: false
type: list
default: ["arm_home", "arm_away", "arm_night", "arm_vacation", "arm_custom_bypass", "trigger"]
unique_id:
description: An ID that uniquely identifies this alarm panel. If two alarm panels have the same unique ID, Home Assistant will raise an exception.
required: false
@ -258,6 +263,26 @@ value_template:
In this section you find some real-life examples of how to use this alarm control panel.
### Configuration with partial feature support
The example below shows a full configuration with an alarm panel that only supports the `arm_home` and `arm_away` features.
{% raw %}
```yaml
# Example with partial feature support
mqtt:
- alarm_control_panel:
name: "Alarm Panel"
supported_features:
- arm_home
- arm_away
state_topic: "alarmdecoder/panel"
command_topic: "alarmdecoder/panel/set"
```
{% endraw %}
### Configuration with local code validation
The example below shows a full configuration with local code validation.