Commit Graph

60 Commits (f89de613d9449f1edd717f00f333dd0546985fb4)

Author SHA1 Message Date
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
Jan Bouwhuis cf52357229
Add MQTT light unknown state support ()
* Add MQTT light unknown sate support

* Update homeassistant/components/mqtt/light/schema_basic.py

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

* Update homeassistant/components/mqtt/light/schema_json.py

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

* Update homeassistant/components/mqtt/light/schema_template.py

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

* Update tests for default unknown state

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-02-03 16:49:57 +01:00
Erik Montnemery f3a89de71f
Fix race when handling updated MQTT discovery data () 2022-02-02 17:12:22 -08:00
Erik Montnemery 1995a825f3
Reject MQTT light discovery using unsupported value_template ()
* Reject MQTT light discovery using unsupported value_template

* Tweak
2022-01-03 17:16: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
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
Marc Mueller 487fa0a905
Use assignment expressions 20 () 2021-10-20 20:31:00 +02:00
Marc Mueller 4f8148f9ea
Use assignment expressions 07 () 2021-10-17 20:24:34 +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 7a4f3fe7b8
Filter MQTT light JSON attributes () 2021-06-28 14:37:26 +02:00
Erik Montnemery 52c142a82d
Add support for color_mode white to MQTT light basic schema ()
* Add support for color_mode white to MQTT light basic schema

* Add missing abbreviations
2021-06-22 11:59:20 +02:00
Erik Montnemery a4587b5f3b
Deprecate support for undocumented value_template in MQTT light () 2021-06-08 08:23:51 +02:00
Erik Montnemery 4e5ec26ce6
Remove value_template from MQTT_RW_PLATFORM_SCHEMA () 2021-06-08 08:23:35 +02:00
Erik Montnemery 76edfe6c62
Fix deprecated value_template for MQTT light () 2021-06-07 14:14:42 -07:00
Erik Montnemery 870c61a622
Add color_mode support to MQTT light with basic schema ()
* Add color_mode support to MQTT light with basic schema

* Update abbreviations

* Silence pylint

* Improve test coverage

* Apply suggestions from code review
2021-05-24 11:37:02 +02:00
Erik Montnemery 9e681cd214
Refactor MQTT basic light pt5: Add RGB color helpers ()
* Refactor MQTT basic light pt5: Add RGB color helpers

* Revert change of rounding instead of truncating RGB
2021-05-17 23:50:12 +02:00
Erik Montnemery 848ab5c2bc
Deduplicate code in MQTT basic light pt4: Add set_optimistic helper () 2021-05-17 16:28:30 +02:00
Erik Montnemery 8c6f4a8c71
Refactor MQTT basic light pt3: Add publish helper () 2021-05-17 14:54:19 +02:00
Erik Montnemery b36021b4fd
Deduplicate code in MQTT basic light pt2: Add restore_state helper ()
* Refactor MQTT basic light pt2: Add restore_state helper

* Update homeassistant/components/mqtt/light/schema_basic.py

Co-authored-by: Shay Levy <levyshay1@gmail.com>

Co-authored-by: Shay Levy <levyshay1@gmail.com>
2021-05-17 14:53:48 +02:00
Erik Montnemery 3ab14d452c
Refactor MQTT basic light pt1: Add add_topic helper () 2021-05-17 12:50:54 +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
Franck Nijhof 86212db71d
Merge of nested IF-IF cases - K-N () 2021-03-27 10:03:15 +01: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
Erik Montnemery 248802efd5
Add MQTT base entity () 2021-01-09 17:46:53 +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 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 b45fa29077
Force color or white mode exclusivity for MQTT lights () 2020-11-09 12:51:01 +01:00
Erik Montnemery e203896638
Align MQTT light's default color temperature () 2020-10-21 15:46:29 +02:00
Erik Montnemery 4d6e694d14
Fix discovery update of MQTT state templates () 2020-09-10 20:52:23 +02:00
Erik Montnemery 9aba1985c7
Fix MQTT light value template () 2020-09-08 23:11:42 +02:00
Erik Montnemery 4c6960ed36
Fix discovery update of MQTT light () 2020-09-02 10:52:33 +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
Pieter Goetschalckx 02a36a9b68
Add min_mireds and max_mireds to MQTT Light ()
* Add min_mireds and max_mireds to MQTT Light

* Add abbreviations for min_mireds and max_mireds

* Add tests for min_mireds and max_mireds
2020-05-10 09:34:48 +02:00
Erik Montnemery f9b420a5a5
Make sure MQTT light brightness is not rounded to 0 () 2020-05-04 15:54:49 -07:00
Erik Montnemery e4333a7a44
Rename Light to LightEntity () 2020-04-26 18:49:41 +02:00
Erik Montnemery fbd197146a
Add MQTT debug info for remaining MQTT integrations () 2020-04-01 11:48:32 -07:00
springstan ba0aaeeddb
Use f-strings in integrations starting with "M" ()
* Use f-strings in integrations starting with "M"

* Format mqtt light init with black

* Fix lint error

* Fix pylint error

* Restore constants

* Update homeassistant/components/mqtt/discovery.py

* Update homeassistant/components/mqtt/discovery.py

* Update homeassistant/components/mqtt/discovery.py

* Update homeassistant/components/mqtt/discovery.py

* Format with Black
2020-03-10 23:34:54 +01: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ä 9b2544c923
Remove some unneeded pylint suppressions () 2020-02-24 16:47:15 -08:00
springstan 1ee7c483a7
Update file headers and outdated documentation links ()
* Update documentation links

* Update file headers v2
2020-02-20 15:29:46 -08:00
Bas Nijholt aeff27680b use isort to sort imports according to PEP8 for light () 2019-12-08 22:46:23 +05:30
Malte Franken 1a5b4c105a Move imports in mqtt component ()
* move imports to top-level in mqtt server

* move imports to top-level in mqtt configflow

* move imports to top-level in mqtt init

* move imports to top-level in mqtt vacuum

* move imports to top-level in mqtt light
2019-10-17 17:04:27 -07:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
cgtobi 2c07bfb9e0 Remove dependencies and requirements ()
* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit fe7171b4cd.

* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit 391355ee2c.

* Remove dependencies and requirements

* Fix flake8 complaints

* Fix more flake8 complaints

* Revert non-component removals
2019-04-12 10:13:30 -07:00