hass-core/homeassistant/components/mqtt
Faidon Liambotis 9fdad592c2
Add option to disable MQTT Alarm Control Panel supported features (#98363)
* Make MQTT Alarm Control Panel features conditional

The MQTT Alarm Control Panel currently enables all features (arm home,
arm away, arm night, arm vacation, arm custom bypass) unconditionally.
This clutters the interface and can even be potentially dangerous, by
enabling modes that the remote alarm may not support.

Make all the features conditional, by adding a new "supported_features"
configuration option, comprising a list of the supported features as
options. Feature enablement seems inconsistent across the MQTT
component; this implementation is most alike to the Humidifier modes
option, but using a generic "supported_features" name that other
implementations may reuse in the future.

The default value of this new setting remains to be all features, which
while it may be overly expansive, is necessary to maintain backwards
compatibility.

* Apply suggestions from code review

* Use vol.Optional() instead of vol.Required() for "supported_features".
* Move the initialization of _attr_supported_features to _setup_from_config.

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

* Apply suggestions from emontnemery's code review

* Use vol.In() instead of cv.multi_seelct()
* Remove superfluous _attr_supported_features initializers, already
  present in the base class.

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Add invalid config tests for the MQTT Alarm Control Panel

* Set expected_features to None in the invalid MQTT Alarm Control Panel tests

* Add another expected_features=None in the invalid tests

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

---------

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-08-18 08:23:48 +02:00
..
light Change naming of MQTT entities to correspond with HA guidelines (#95159) 2023-07-21 12:52:10 +02:00
vacuum Change naming of MQTT entities to correspond with HA guidelines (#95159) 2023-07-21 12:52:10 +02:00
__init__.py Add MQTT event entity platform (#96876) 2023-07-23 14:42:14 +02:00
abbreviations.py Add MQTT event entity platform (#96876) 2023-07-23 14:42:14 +02:00
alarm_control_panel.py Add option to disable MQTT Alarm Control Panel supported features (#98363) 2023-08-18 08:23:48 +02:00
binary_sensor.py Change naming of MQTT entities to correspond with HA guidelines (#95159) 2023-07-21 12:52:10 +02:00
button.py Change naming of MQTT entities to correspond with HA guidelines (#95159) 2023-07-21 12:52:10 +02:00
camera.py Change naming of MQTT entities to correspond with HA guidelines (#95159) 2023-07-21 12:52:10 +02:00
client.py Use asyncio.timeout [core] (#98447) 2023-08-15 08:36:05 -05:00
climate.py Allow float for inital MQTT climate temperature (#97995) 2023-08-08 23:44:49 +02:00
config.py
config_flow.py Only expose MQTT advanced settings in advanced mode (#91996) 2023-04-25 22:23:17 +02:00
config_integration.py Add MQTT event entity platform (#96876) 2023-07-23 14:42:14 +02:00
const.py Add option to disable MQTT Alarm Control Panel supported features (#98363) 2023-08-18 08:23:48 +02:00
cover.py Change naming of MQTT entities to correspond with HA guidelines (#95159) 2023-07-21 12:52:10 +02:00
debug_info.py
device_automation.py
device_tracker.py Change naming of MQTT entities to correspond with HA guidelines (#95159) 2023-07-21 12:52:10 +02:00
device_trigger.py
diagnostics.py
discovery.py Add MQTT event entity platform (#96876) 2023-07-23 14:42:14 +02:00
event.py Ruff: isort don't split imports based on trailing comma (#98162) 2023-08-10 14:27:03 +02:00
fan.py Change naming of MQTT entities to correspond with HA guidelines (#95159) 2023-07-21 12:52:10 +02:00
humidifier.py Change naming of MQTT entities to correspond with HA guidelines (#95159) 2023-07-21 12:52:10 +02:00
image.py Ruff: isort don't split imports based on trailing comma (#98162) 2023-08-10 14:27:03 +02:00
lock.py Change naming of MQTT entities to correspond with HA guidelines (#95159) 2023-07-21 12:52:10 +02:00
manifest.json
mixins.py Move DeviceInfo from entity to device registry (#98149) 2023-08-10 22:04:26 -04:00
models.py Offer work- a-round for MQTT entity names that start with the device name (#97495) 2023-08-01 10:03:08 +02:00
number.py Change naming of MQTT entities to correspond with HA guidelines (#95159) 2023-07-21 12:52:10 +02:00
scene.py Ruff: isort don't split imports based on trailing comma (#98162) 2023-08-10 14:27:03 +02:00
select.py Change naming of MQTT entities to correspond with HA guidelines (#95159) 2023-07-21 12:52:10 +02:00
sensor.py Change naming of MQTT entities to correspond with HA guidelines (#95159) 2023-07-21 12:52:10 +02:00
services.yaml Migrate mqtt services to support translations (#96396) 2023-07-12 10:37:59 -04:00
siren.py Change naming of MQTT entities to correspond with HA guidelines (#95159) 2023-07-21 12:52:10 +02:00
strings.json Update strings.json to correct grammer. (#97790) 2023-08-04 21:23:33 +02:00
subscription.py Replace isort with ruff (#94302) 2023-06-08 23:43:56 +02:00
switch.py Change naming of MQTT entities to correspond with HA guidelines (#95159) 2023-07-21 12:52:10 +02:00
tag.py Improve mqtt tag schema logging and avoid tests that use xfail (#95711) 2023-07-11 10:12:31 +02:00
text.py Change naming of MQTT entities to correspond with HA guidelines (#95159) 2023-07-21 12:52:10 +02:00
trigger.py Inverse json import logic (#88099) 2023-02-16 11:37:57 +01:00
update.py Change naming of MQTT entities to correspond with HA guidelines (#95159) 2023-07-21 12:52:10 +02:00
util.py Use asyncio.timeout [core] (#98447) 2023-08-15 08:36:05 -05:00
water_heater.py Add turn on/off support for mqtt water_heater (#97197) 2023-07-25 13:33:02 +02:00