* Only call `async_ha_write_state` on changes.
* Make helper class
* Use UndefinedType
* Remove del
* Integrate monitor into MqttEntity
* Track extra state attributes and availability
* Add `__slots__`
* Add monitor to MqttAttributes and MqttAvailability
* Write out loop
* Add test
* Make common test and parameterize
* Add test for last_reset attribute
* MqttMonitorEntity base class
* Rename attr and update docstr `track` method.
* correction doct
* Implement as a decorator
* Move tracking functions into decorator
* Rename decorator
* Follow up comment
* Log entity_id payload and template on error
* Also handle cases with default values.
* Do not log payload twice
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Tweak test to assert without payload
* black
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* 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>
* Allow float for inital MQTT climate temperature
* Update tests/components/mqtt/test_climate.py
Co-authored-by: Erik Montnemery <erik@montnemery.com>
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Set has_entity_name if device_name is set
* revert unneeded formatting change
* Add image platform
* Follow up comment
* Don't set `has_entity_name` without device name
* Only set has_entity_name if a valid name is set
* Follow device_class name and add tests
* Follow up comments add extra tests
* Move to helper - Log a warning
* fix test
* Allow to assign None as name explictly
* Refactor
* Log info messages when device name is not set
* Revert scene schema change - no device link
* Always set has_entity_name with device mapping
* Always set `_attr_has_entity_name`
* Cleanup