1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00
Commit Graph

517 Commits

Author SHA1 Message Date
Jan Bouwhuis
efe5b0ca81 Add command template for MQTT button (#63838)
* Add command template for MQTT button

* Move CONF_COMMAND_TEMPLATE
2022-01-23 12:48:41 +01:00
Jan Bouwhuis
31a9d64572 Improve code coverage MQTT integration (#64546) 2022-01-20 13:51:19 +01:00
Jan Bouwhuis
aa73e5bd72 Fix MQTT climate optimistic preset modes (#63463)
* Always publish when preset_mode is set

* Revert "Fixed isort error"

This reverts commit 1a3c5e6460.

* isort
2022-01-11 17:08:26 +01:00
Erik Montnemery
3083f059cc Drop last_reset attribute for non 'total' sensors (#63880)
* Drop last_reset attribute for non 'total' sensors

* Adjust MQTT tests

* Add exception for utility_meter

* Rewrite exception for utility_meter

* Add comment in utility_meter

* Tweak comment
2022-01-11 13:58:35 +01:00
Orce MARINKOVSKI
b78e22e012 Update MQTT light schema template (#62759)
* shema template update

* tests to cover the additional template variables

* fix flake8: too many blank lines

* Update schema_template.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-01-10 09:57:56 +01:00
Franck Nijhof
3f7275a9c7 Give scenes last activated state (#62673) 2022-01-07 19:02:32 +01:00
Erik Montnemery
1995a825f3 Reject MQTT light discovery using unsupported value_template (#62682)
* Reject MQTT light discovery using unsupported value_template

* Tweak
2022-01-03 17:16:26 +01:00
Jan Bouwhuis
86ed091dbf Skip raw encoding test for cover (#63322) 2022-01-03 17:08:28 +01:00
Jan Bouwhuis
dd0193052c Add MQTT encoding parameter for all subscribed topics (#62263)
* Add encoding parameter for all subscribable topics

* test setup encoding incoming payload

* remove support for device_tracker and tag+tests
2022-01-03 16:08:07 +01:00
Jan Bouwhuis
3ca18922e6 Mqtt rework on value templates (#62105)
* add MqttValueTemplate class

* support variables at initiation

* pass MqttEntity instead of hass

* Use MqttValueTemplace class for value templates

* make hass en enitity parameters conditional

* remove unused property and remove None assignment

* rename self._attr_value_template
2022-01-03 16:07:40 +01:00
Jan Bouwhuis
061ce0c187 Fix mqtt reloading and rework tests (#62950)
* Improve mqtt reloading/tests and fix issues

* Cleanup fixture for reloading test

* isort and black remove replaced test_reloadable
2022-01-03 15:14:50 +01:00
Jan Bouwhuis
0dab5e69db Fix MQTT cover not using tilt_command_template (#63080) 2022-01-03 15:13:30 +01:00
Jan Bouwhuis
457ce195dd Add mqtt entity attributes command templates (#61937)
* Add entity variables to MqttCommandTemplate

* missing command template update

* make hass and entity conditional parameters

* Add encoding support for publishing

* Revert "Add encoding support for publishing"

This reverts commit b69b9c60ec.
2022-01-03 15:10:15 +01:00
Jan Bouwhuis
d0c4f0fec4 Add mqtt encoding support for publishing (#62739)
* encoding support for mqtt publishing - todo tests

* signature allows None values for qos and retain

* common test for mqtt publishing encoding

* better test with command templates

* more tests

* fix tests alarm control panel+tests light basic

* tests light json and template

* add tests vacuum and fix tests light_template
2022-01-03 09:03:47 +01:00
Franck Nijhof
60b2cdd069 Allow binary sensor state to be None (#60193) 2021-12-22 12:24:29 +01:00
Dave T
043a4b06d0 Use new enums in mqtt tests (#62520) 2021-12-21 22:04:32 +01:00
Ville Skyttä
f913961d63 Use DeviceAutomationType in tests/components/[m-r]* (#62443) 2021-12-20 22:29:22 +01:00
Jan Bouwhuis
d5defa8995 Support publishing MQTT messages with raw bytes payloads (#61090)
* correctly publish mqtt ouput

* Additional tests

* Add template test with binary output

* render_outgoing_payload with command templates

* use MqttCommandTemplate helper class

* add tests command_template

* Additional tests

* support pass-through for MqttComandTemplate

* fix bugs

* unify workform always initiate with hass

* clean up

* remove not needed lines

* comment not adding value
2021-12-15 11:28:43 +01:00
epenet
c05eca1c82 Remove log flooding prevention logic from discovery info (#61243)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-08 10:28:26 -10:00
Jan Bouwhuis
88b93546f3 Re-add-tests with new filters removed with #60854 (#60895) 2021-12-03 11:04:05 -08:00
epenet
b65b25c1bb Move MqttServiceInfo to init.py (#60905)
Co-authored-by: epenet <epenet@users.noreply.github.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-12-03 19:34:48 +01:00
epenet
358922db56 Use dataclass for HassioServiceInfo (#60824)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-03 14:05:56 +01:00
Erik Montnemery
9f4a99fe81 Revert "Add bytes support for bitwise template operations" (#60854) 2021-12-03 08:50:29 +01:00
J. Nick Koston
d7c4a669f1 Revert "Use HassioServiceInfo in mqtt tests" (#60867) 2021-12-02 10:13:41 -10:00
epenet
37200decf9 Use HassioServiceInfo in mqtt tests (#60865) 2021-12-02 10:10:50 -10:00
Jan Bouwhuis
3307e54363 Add MQTT availability template and encoding (#60470)
* Add MQTT availability template and encoding

* use generic encoding field

* pylint and cleanup

* remove additional topic check
2021-12-02 10:21:31 +01:00
epenet
6caaa5f6bd Add compatibility tests for MqttServiceInfo (#60754)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-01 17:04:49 +01:00
Franck Nijhof
16462df451 Add button device classes to MQTT (#60628) 2021-11-30 16:08:02 +01:00
Jan Bouwhuis
cd351cf22b Fix test naming switch (#60630) 2021-11-30 15:45:06 +01:00
Jan Bouwhuis
2a2a20fcb3 Add mqtt sensor configurable state encoding for sensor and binary_sensor platform (#60447)
* Add mqtt sensor state encoding

* Make encoding attribute not specific to states

* Move encoding attribute to schema base
2021-11-30 14:04:24 +01:00
Raphaël Beamonte
8600b5597a Add 'trigger' support for MQTT Alarm Control Panel (#60525)
When configuring an Alarm Control Panel through MQTT discovery, it
was not possible to use the trigger service. This fixes that by making
it available the same way as ARM and DISARM services are.
2021-11-29 14:41:52 +01:00
Hypnos
57fd632cd9 Add missing MQTT lock.open (#60022)
* Add missing MQTT lock.open

from:
https://community.home-assistant.io/t/mqtt-lock-open/232823/13
based on https://github.com/home-assistant/core/pull/48008

* Update homeassistant/components/mqtt/lock.py

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

* Update homeassistant/components/mqtt/lock.py

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

* Update homeassistant/components/mqtt/lock.py

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

* removed `STATE_OPEN` from tests

* Apply suggestions from code review

* Format code

* Update lock.py

* Update test_lock.py

* Update test_lock.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-11-25 15:54:08 +01:00
Till Skrodzki
635d875b1d Only accept valid hvac actions sent via mqtt (#59919)
* Only accept valid hvac actions sent via mqtt

* Only accept valid hvac actions sent via mqtt

* Fix existing action test and remove old one

* Remote None as valid hvac action being accepted

* Change loglevel of wrong hvac action received
2021-11-25 15:53:34 +01:00
Erik Montnemery
7c3edf24f2 Allow MQTT selects to have a single or no options (#60281) 2021-11-24 20:06:12 +01:00
Franck Nijhof
5c443b626a Use native datetime value in MQTT sensors (#59923) 2021-11-23 22:10:14 +01:00
David Beitey
1bcd62cd32 Add topic_template for mqtt.publish (#53743)
Co-authored-by: Erik Montnemery <erik@montnemery.com>

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-11-16 16:13:54 +01:00
Erik Montnemery
b5ce84cd89 Add MQTT button (#59348) 2021-11-09 12:04:14 +01:00
Damien Duboeuf
67c2747027 Add MQTT object_id option (#58728)
* Add MQTT object_id option

* Add MQTT object_id option

* Add MQTT object_id option

* Add MQTT object_id option - Fix light and vacuum

* Add MQTT object_id option - Fix light and vacuum

* Add MQTT object_id option - Fix lock

* Add MQTT object_id option - Fix device

* Add MQTT object_id option - Fix device

* Update tests/components/mqtt/test_discovery.py

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

* Change deprecated method

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-11-08 14:02:18 +01:00
Jan Bouwhuis
0c4863198e Add command_template to MQTT number platform (#58949) 2021-11-02 18:21:49 +01:00
Chris Browet
2df1ba2346 Add device_class to MQTT switch (#58931) 2021-11-02 17:40:05 +01:00
Jan Bouwhuis
339117aceb Add command_template to mqtt select platform (#58934) 2021-11-02 17:33:23 +01:00
Paulus Schoutsen
31153ac155 Move fixtures part 1 (#58902) 2021-11-01 20:47:05 -07:00
Erik Montnemery
f3bd13d179 Fix regression in MQTT discovery (#58684)
* Fix regression in MQTT discovery

* Update test
2021-10-29 15:59:16 +02:00
Erik Montnemery
0456a896e3 Avoid service call in MQTT async_publish function (#58441)
* Avoid service call in MQTT async_publish function

* Tweak

* Fix integrations + tests
2021-10-28 08:13:32 +02:00
Erik Montnemery
640a7fee9d Allow extra keys in MQTT discovery messages (#58390)
* Allow extra keys in MQTT discovery messages

* Remove extra keys
2021-10-25 13:47:06 +02:00
Franck Nijhof
027e167d95 Add support for unit of measurement in MQTT number platform (#58343) 2021-10-25 09:44:43 +02:00
Ville Skyttä
77120a5137 Use http.HTTPStatus in components/m* (#58251) 2021-10-22 23:54:36 +02:00
Jan Bouwhuis
58569a58a9 MQTT Alarm control panel - Enable remote code validation (#57764)
* Enable remote code validation

* Update homeassistant/components/mqtt/alarm_control_panel.py

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

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-10-19 12:07:38 +02:00
Erik Montnemery
1eebe45154 Add support for entity categories to MQTT entities (#57656)
* Add support for entity categories to MQTT entities

* Improve test

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Update homeassistant/components/mqtt/mixins.py

Co-authored-by: Paul Monigatti <paulmonigatti@users.noreply.github.com>

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Paul Monigatti <paulmonigatti@users.noreply.github.com>
2021-10-15 14:28:30 +02:00
Franck Nijhof
eed9f67402 Add service configuration URL to MQTT (#57731) 2021-10-14 18:27:40 -07:00