Commit graph

71 commits

Author SHA1 Message Date
Jan Bouwhuis
e8664ce1ae
Move manual configuration of MQTT climate to the integration key ()
Add climate

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-05-22 11:28:10 +02:00
epenet
a0f741778a
Use HVACAction in mqtt () 2022-05-12 14:12:21 +02:00
epenet
1be2438ef6
Use climate enums in mqtt () 2022-05-09 08:15:11 +02:00
epenet
3e426c0fa6
Use EntityFeature enum in mqtt () 2022-04-07 09:44:26 +02:00
Jan Bouwhuis
98adeb6070
Fix false positive MQTT climate deprecation warnings for defaults ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-03-07 15:38:33 +01:00
Jan Bouwhuis
83846bb5cc
MQTT climate preset_modes rework ()
* MQTT climate preset_modes rework

* Set deprection date to 2022.9 (6 months)

* add valid_preset_mode_configuration for discovery

* Update deprecation date
2022-02-17 13:51:35 +01:00
Erik Montnemery
fe38e6ba87
Drop MQTT import flow ()
* Drop MQTT import flow

* Reload manually configured MQTT entities when config entry is setup

* Address review comments

* Actually remove the import flow
2022-02-10 21:09:57 +01:00
Jan Bouwhuis
678e56b8b7
Mqtt move to .const () 2022-02-10 09:18:35 +01:00
Erik Montnemery
8245ff7473
Log transmitted MQTT messages () 2022-02-04 17:35:32 +01:00
Erik Montnemery
f3a89de71f
Fix race when handling updated MQTT discovery data () 2022-02-02 17:12:22 -08:00
Jan Bouwhuis
0cabf3e577
Fix MQTT climate action null warnings () 2022-01-27 08:41:27 +01:00
Jan Bouwhuis
65deaa1daf
Always send hvac_mode deprecate send_if_off () 2022-01-11 17:12:48 +01:00
Jan Bouwhuis
aa73e5bd72
Fix MQTT climate optimistic preset modes ()
* Always publish when preset_mode is set

* Revert "Fixed isort error"

This reverts commit 1a3c5e6460.

* isort
2022-01-11 17:08:26 +01:00
Jan Bouwhuis
dd0193052c
Add MQTT encoding parameter for all subscribed topics ()
* 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 ()
* 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
457ce195dd
Add mqtt entity attributes command templates ()
* 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 ()
* 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
epenet
2cc4d9846b
Add basic type hints to mqtt ()
* Add basic type hints to mqtt

* Add hints to async_setup_platform

* Add type hint to async_setup_entry

* Fix pylint

* Set correct argument order in climate entity

Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-03 08:53:52 +01:00
epenet
20150daf1e
Fix incorrect parameter name/hint in mqtt climate ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-02 17:06:17 +01:00
Jan Bouwhuis
d5defa8995
Support publishing MQTT messages with raw bytes payloads ()
* 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
Till Skrodzki
635d875b1d
Only accept valid hvac actions sent via mqtt ()
* 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
Damien Duboeuf
67c2747027
Add MQTT object_id option ()
* 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
Erik Montnemery
0456a896e3
Avoid service call in MQTT async_publish function ()
* 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 ()
* Allow extra keys in MQTT discovery messages

* Remove extra keys
2021-10-25 13:47:06 +02:00
Jan Bouwhuis
879144b48d
MQTT rework constants ()
* reference CONF_TOPIC to .const

* Organize common mqtt constants
2021-10-12 11:26:38 +02:00
Erik Montnemery
040c88f982
Filter MQTT climate JSON attributes () 2021-06-29 11:13:58 +02:00
J. Nick Koston
3fa8ffa731
Enable mccabe complexity checks in flake8 ()
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-25 12:38:40 +02:00
jan iversen
9410aefd0d
Integrations m*: Rename HomeAssistantType to HomeAssistant. () 2021-04-22 14:53:37 -07:00
Kristian Heljas
9e487eb260
Hoist mqtt name property and add icon support to MqttEntity ()
* hoist common MqttEntity properties

* remove default name for MqttEntity

Default naming is sensible enough

* disable overriding common MqttEntity schema

* merge common MqttEntity schemas into MQTT_ENTITY_COMMON_SCHEMA
2021-03-11 13:42:13 +01:00
tkdrob
b85ecc0bd2
Use core constants for mqtt () 2021-02-11 13:38:33 +01:00
radovanbauer
baab9b9a81
Added command templates for the mqtt climate component. ()
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
248802efd5
Add MQTT base entity () 2021-01-09 17:46:53 +01:00
Erik Montnemery
6dd6d9b368
Deduplicate MQTT entity discovery code () 2021-01-09 14:37:33 +01:00
Erik Montnemery
b85efd343f
Move MQTT entity helpers to separate file ()
* Move MQTT entity helpers to separate file

* Fix imports

* Update MQTT number

* Review comments

* Fix formatting
2021-01-09 00:47:17 +01:00
Erik Montnemery
34bd70aee6
Fix race when handling MQTT discovery messages ()
* Fix race when handling MQTT discovery messages

* Lint

* retrigger checks
2021-01-04 12:28:17 +01:00
Erik Montnemery
97edbaa85f
Small cleanup of MQTT ()
* Use relative imports of mqtt component in mqtt platforms

* Correct parameters to _async_setup_entity

* Lint
2020-12-10 21:30:07 +01:00
Erik Montnemery
52e1282d8c
Make MQTT climate return PRESET_NONE when no preset is set () 2020-11-16 20:10:55 +01:00
J. Nick Koston
65e53b8251
Support reloading mqtt yaml configuration () 2020-09-02 20:16:21 -05:00
Franck Nijhof
1c2ebdf307
Upgrade black to 20.8b1 () 2020-08-27 13:56:20 +02:00
Michaël Arnauts
d7d7ee6524
Use global CONF_UNIQUE_ID for mqtt ()
* Use global CONF_UNIQUE_ID for mqtt

* Update __init__.py

* Update __init__.py

* Update __init__.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-08-09 16:00:14 -05:00
Erik Montnemery
29bc93ea98
Rename ClimateDevice to ClimateEntity () 2020-04-25 18:04:03 +02:00
presslab-us
e41753556c
Add MQTT climate temperature unit ()
* Add MQTT temperature unit
2020-04-15 20:11:04 +02:00
Erik Montnemery
fbd197146a
Add MQTT debug info for remaining MQTT integrations () 2020-04-01 11:48:32 -07:00
Erik Montnemery
7e387f93d6
Add MQTT WS command to remove device ()
* Add MQTT WS command to remove device

* Review comments, fix test

* Fix tests
2020-02-24 20:46:02 -08:00
Ville Skyttä
5216477353
Be consistent with Home Assistant and Hass.io spelling ()
* Be consistent with Home Assistant spelling

* Be consistent with Hass.io spelling
2020-01-05 14:09:17 +02:00
Paulus Schoutsen
52818bdb89
Make Hassfest stricter pt 2 ()
* Make Hassfest stricter

* Fix if-condition

* Small cleanup
2019-12-19 14:00:22 +01:00
Bas Nijholt
ce5072fc91 use isort to sort imports according to PEP8 for mqtt () 2019-12-08 22:45:26 +05:30
Dmitry Krasnoukhov
4881bc04d8 Allow to change MQTT climate hold mode () 2019-11-25 20:53:37 -08:00
Kevin Köck
b7153ca207 Add mqtt temp_low/high_template in SCHEMA_BASE ()
* fix missing temp_low/high_template in SCHEMA_BASE

* temperature_high/low_state_template test

* Update test_climate.py

* paste error

* Update test_climate.py

* Update test_climate.py

* Update test_climate.py

* Update test_climate.py
2019-11-06 07:50:54 -05:00
Paulus Schoutsen
4de97abc3a Black 2019-07-31 12:25:30 -07:00