* Shared fixture on TEMP_DIR_NAME mock in MQTT tests
* Improve mqtt certificate file tests
* Update tests/components/mqtt/test_util.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update tests/components/mqtt/conftest.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Avoid blocking code
* typo in sub function
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
* 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
* Add url support for mqtt image platform
* Refactor url fetch code to use base platform
* Update after rebase
---------
Co-authored-by: Erik <erik@montnemery.com>
* Add mqtt image platform
* Follow up comments
* Use separate topics
* Set last_ image to `None` on error
* Fix encoding and schema validation
* Assing None to last_image when get image fails
* Follow up comment
* Remove content_type validation
* Add validation
* Rename options according suggestions
* Remove url_topic / template feature from PR
* Always set content_type
* Add Water Heater entity to MQTT
* Adding tests for Water Heater
* Remove duplicate line and unneeded var declaration
* Remove target temp range and away mode
* Move common Temperature Control conf to const
* Remove unnecessary platform schema and temp check
* Add common value template key test
* Use MqttTemperatureControl in Water Heater
* Move operation mode out of MqttTemperatureControl
* Remove unecessary attribute declaration
* Remove default min/max temp and auto init attr
* Fix mqtt water heater initial temp conversion
* Make async_set_temperature common
* Fix init temp comment
* Merge value_template_keys into get_with_templates
* Remove unnecessary operation_mode overriding
* Add async_set_temperature to water heater
* Fix docstring comments
* Do not trigger reload when unloading MQTT entry
* More cleanup
* cleanup async_reload_manual_mqtt_items
* Add test
* Improve test
* Remove unuse mocks from test
* Add discovery item in test