Commit graph

283 commits

Author SHA1 Message Date
Erik Montnemery
411c0a9685
Improve MQTT JSON light to allow non-ambiguous states (#45522) 2021-02-02 09:36:00 +01:00
radovanbauer
baab9b9a81
Added command templates for the mqtt climate component. (#44976)
This allows integrating with devices which require more complex payloads to be posted when updating their values.

Old feature request: https://github.com/home-assistant/core/issues/11496
There are numerous posts requesting this feature, example: https://community.home-assistant.io/t/need-help-with-value-template-for-mqtt-hvac/73395/68https://community.home-assistant.io/t/need-help-with-value-template-for-mqtt-hvac/73395/68

Command templates have been added for the following:
- fan_mode
- hold
- mode
- swing_mode
- temperature
- temperature high/low

This doesn't add templates for aux, away mode, power since these already accept custom payload_on/off (although they all share the same payload). It should be straightforward to add templates for them as well if needed.
2021-01-26 16:12:33 +01:00
Erik Montnemery
f86beed7b0
Subscribe only to valid MQTT discovery topics (#45456) 2021-01-23 08:51:25 -05:00
J. Nick Koston
954ad854fb
Remove the ability for mqtt to set speeds that are not in the speed_list (#45445) 2021-01-23 06:24:06 +01:00
Erik Montnemery
d60fc0de38
Add availability_mode "all" and "any" to MQTT entities (#44987)
* Add availability_mode "all" to MQTT entities

* Add availability mode any
2021-01-11 16:04:22 +01:00
Erik Montnemery
b85efd343f
Move MQTT entity helpers to separate file (#44838)
* Move MQTT entity helpers to separate file

* Fix imports

* Update MQTT number

* Review comments

* Fix formatting
2021-01-09 00:47:17 +01:00
Diogo Gomes
e3c1281616
Add MQTT Number (non optimistic) (#44883)
* non optimistic

* test restored state

* ups

* review

* Ensure the entity is not in optimistic mode

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

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-01-08 23:43:14 +01:00
Ville Skyttä
2fb3be50ab
Make DeviceRegistry.async_get_device connections arg optional (#44897)
* Make async_get_device connections Optional, default None

* Remove unnecessary async_get_device connections arg usages

Some of these were using an incorrect collection type, which didn't
cause issues mostly just due to luck.
2021-01-07 13:49:45 +01:00
Erik Montnemery
93ae65d704
Improve MQTT number test coverage (#44870) 2021-01-06 13:27:05 +01:00
Diogo Gomes
f18880686c
Add MQTT Number (#44739)
* Initial Commit

* initial commit

* add discovery and tests

* increase coverage

* address review

* catchup with reality
2021-01-06 08:27:46 +01:00
Erik Montnemery
34bd70aee6
Fix race when handling MQTT discovery messages (#44730)
* Fix race when handling MQTT discovery messages

* Lint

* retrigger checks
2021-01-04 12:28:17 +01:00
Franck Nijhof
65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
PeteBa
727b1d37b6
Add discovery for MQTT device tracker (#42327) 2020-12-07 13:16:56 +01:00
Philip Allgaier
18736dbebf
Bump voluptuous to 0.12.1 (#44002)
* Bump voluptuous to 0.12.1

* Adjust MQTT climate test to new error msg
2020-12-07 02:49:36 +01:00
Erik Montnemery
5e6f5fca90
Don't send MQTT birth message in tests (#43917) 2020-12-04 04:39:49 +01:00
Kiall Mac Innes
8efa9c5097
Add support for MQTT Scenes (#42639) 2020-12-02 19:42:28 +01:00
Erik Montnemery
8ff10ad3b8
Fix MQTT threading bug (#43667) 2020-11-26 22:33:58 +01:00
Paulus Schoutsen
b3be708db6
Add default config if not there (#43321)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-11-25 15:10:04 +01:00
Erik Montnemery
52e1282d8c
Make MQTT climate return PRESET_NONE when no preset is set (#43257) 2020-11-16 20:10:55 +01:00
Erik Montnemery
4e49bd0596
Correct handling of existing MQTT subscriptions (#43056) 2020-11-10 21:55:26 +01:00
Erik Montnemery
b45fa29077
Force color or white mode exclusivity for MQTT lights (#42887) 2020-11-09 12:51:01 +01:00
Paulus Schoutsen
d4efa938dd
Improve mqtt test (#42490) 2020-10-27 23:22:59 +01:00
Paulus Schoutsen
6380ebd1eb
Fix MQTT publish from a script with templates (#42398) 2020-10-26 16:46:26 +01:00
Paulus Schoutsen
5dac3883b0
Stub light profiles (#42232) 2020-10-23 16:28:21 +02:00
Erik Montnemery
e203896638
Align MQTT light's default color temperature (#41842) 2020-10-21 15:46:29 +02:00
Tim Werner
e5aa5e2c35
rewrite mqtt unittest tests to pytest style (#42122) 2020-10-20 16:35:49 +02:00
Erik Montnemery
343e5d64b8
Add MQTT integration discovery (#41332)
* Add MQTT integration discovery

* Add script/hassfest/mqtt.py

* Unsubscribe if config entry exists

* Add homeassistant/generated/mqtt.py

* Fix bad loop

* Improve tests

* Improve tests

* Apply suggestions from code review

Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch>

* Prevent initiating multiple config flows

Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch>
2020-10-07 18:30:51 +02:00
Erik Montnemery
306ee30574
Enable MQTT discovery by default (#41361) 2020-10-07 14:51:06 +02:00
Franck Nijhof
ee914366a8
Add native Python types support to templates (#41227)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-10-07 00:05:52 +02:00
Erik Montnemery
c777647233
Drop legacy_patchable_time from MQTT tests (#41287) 2020-10-05 21:39:44 +02:00
Erik Montnemery
13dad34019
Reorder MQTT binary sensor tests (#41277) 2020-10-05 19:42:28 +02:00
Erik Montnemery
e7f832a82f
Add MQTT tag scanner (#40709) 2020-09-28 22:04:27 +02:00
Franck Nijhof
8837ed35cd
Use direct service calls in tests instead of automation common (#40623)
* Use direct service calls in tests instead of automation common

* Remove automation common test helpers
2020-09-26 19:28:26 +02:00
Erik Montnemery
4d6e694d14
Fix discovery update of MQTT state templates (#39901) 2020-09-10 20:52:23 +02:00
Erik Montnemery
9aba1985c7
Fix MQTT light value template (#39820) 2020-09-08 23:11:42 +02:00
J. Nick Koston
65e53b8251
Support reloading mqtt yaml configuration (#39531) 2020-09-02 20:16:21 -05:00
Erik Montnemery
4c6960ed36
Fix discovery update of MQTT light (#39325) 2020-09-02 10:52:33 +02:00
Franck Nijhof
1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Erik Montnemery
114a7226d6
Wait before sending MQTT birth message (#39120)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-08-25 16:42:24 +02:00
Erik Montnemery
ee043d8614
Wait for broker to ACK MQTT operations (#39051)
* Wait for broker to ACK MQTT operations

* Deduplicate new code

* Fix tests

* Improve test

* Don't hold PAHO lock when waiting for ACK

* Fix tests

* Add constant for ACK timeout
2020-08-21 17:00:13 +02:00
Phil Bruckner
ca9dd0c833
Reorganize trigger code (#38655) 2020-08-17 11:54:56 -05:00
Erik Montnemery
4ed1f8023b
Suppress MQTT discovery updates without changes (#38568) 2020-08-06 10:43:47 +02:00
Erik Montnemery
686e6b8fc3
Add test (#37890) 2020-07-24 12:29:19 +02:00
Erik Montnemery
fa0e12ffe8
Use keywords for MQTT birth and will (#38040) 2020-07-21 14:10:34 -07:00
Erik Montnemery
908b72370b
Correct arguments to MQTT will_set (#38036) 2020-07-21 12:36:21 -07:00
J. Nick Koston
910b6c9c2c
Index entity_registry_updated listeners (#37940) 2020-07-17 21:59:18 -07:00
Erik Montnemery
fb3049d6a2
Set MQTT sensor to state unavailable when value expires (#36609) 2020-07-08 16:20:19 -07:00
Erik Montnemery
b63655057c
Publish birth and will messages by default (#37371)
* Publish birth and will messages by default

* Remove useless copy
2020-07-04 17:49:08 +02:00
Erik Montnemery
4b3ad0a1cd
Support multiple MQTT availability topics (#37418)
* Support multiple MQTT availability topics

* Make availability list and availability_topic exclusive

* Make availability list and availability_topic exclusive

* Add missing abbreviation
2020-07-04 17:48:34 +02:00
Erik Montnemery
9ade1de3d5
Support empty output of MQTT binary_sensor value_template (#37420)
* Support empty output of MQTT binary_sensor value_template

* Strip white space

* Add test

* Add test
2020-07-04 17:48:02 +02:00