Commit Graph

1036 Commits (e7b550685e451f830ebb1069c720c73381e6befb)

Author SHA1 Message Date
Jan Bouwhuis aee82e2b3b
De-duplicate MQTT config_flow code (#79369)
* De-duplicate config_flow code

* De duplicate code birth and will
2022-10-07 10:12:19 +02:00
Jan Bouwhuis 9c9c8b324a
Ignore an '' value_template result for MQTT sensor (#79417)
Do not write state if payload is ''
2022-10-01 19:00:54 +03:00
Jan Bouwhuis 84b2c74746
Move MQTT discovery hass.data globals to dataclass (#78706)
* Add MQTT discovery hass.data globals to dataclass

* isort

* Additional rework

* Add hass.data["mqtt_tags"] to dataclass

* Follow-up comment

* Corrections
2022-09-28 14:13:44 +02:00
Jan Bouwhuis c5a58c8501
Fix MQTT setup after changing config entry flow options (#79103)
Fix issues with config flow options
2022-09-27 08:05:28 +02:00
Jan Bouwhuis 7216d4c636
Add debug logging for MQTT templates (#79016) 2022-09-27 00:36:10 +02:00
Jan Bouwhuis bdcece4904
Fix MQTT device_tracker generating unique id-s - regression on #78547 (#79033) 2022-09-24 22:03:03 -04:00
Jan Bouwhuis 81514b0d1c
Move MQTT debug_info to dataclass (#78788)
* Add MQTT debug_info to dataclass

* Remove total attr, assign factory

* Rename typed dict to MqttDebugInfo and use helper

* Split entity and trigger debug info

* Refactor

* More rework
2022-09-23 20:55:29 +02:00
epenet e58531f118
Add MqttData helper to mqtt (#78825)
* Add MqttData helper to mqtt

* Adjust client for circular dependencies

* Move MqttData to models.py

* Move get_mqtt_data to util.py
2022-09-20 19:40:06 +02:00
Jan Bouwhuis 354411feed
Link manually added MQTT entities the the MQTT config entry (#78547)
Co-authored-by: Erik <erik@montnemery.com>
2022-09-18 12:55:31 -04:00
GitHub Action e9eb5dc338 [ci skip] Translation update 2022-09-18 00:29:50 +00:00
Jan Bouwhuis 1f410e884a
Make hass.data["mqtt"] an instance of a DataClass (#77972)
* Use dataclass to reference hass.data globals

* Add discovery_registry_hooks to dataclass

* Move discovery registry hooks to dataclass

* Add device triggers to dataclass

* Cleanup DEVICE_TRIGGERS const

* Add last_discovery to data_class

* Simplify typing for class `Subscription`

* Follow up on comment

* Redo suggested typing change to sasisfy mypy

* Restore typing

* Add mypy version to CI check logging

* revert changes to ci.yaml

* Add docstr for protocol

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>

* Mypy update after merging #78399

* Remove mypy ignore

* Correct return type

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2022-09-17 21:43:42 +02:00
GitHub Action ec258410c5 [ci skip] Translation update 2022-09-16 00:29:29 +00:00
Erik Montnemery 8a55f85703
Improve MQTT debug log of retained messages (#78453)
Improve MQTT debug log for retained messages
2022-09-14 20:45:46 +02:00
GitHub Action 955f3b7083 [ci skip] Translation update 2022-09-13 00:29:19 +00:00
GitHub Action 051974304a [ci skip] Translation update 2022-09-11 00:27:01 +00:00
epenet 6affd9c6fb
Import climate constants from root [m-z] (#78178) 2022-09-10 23:42:28 +02:00
Jan Bouwhuis fb67123d77
Clear MQTT discovery topic when a disabled entity is removed (#77757)
* Cleanup discovery on entity removal

* Add test

* Cleanup and test

* Test with clearing payload not unique id

* Address comments

* Tests cover and typing

* Just pass hass

* reuse code

* Follow up comments revert changes to cover tests

* Add test unique_id has priority over disabled

* Update homeassistant/components/mqtt/__init__.py

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

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-09-09 15:24:26 +02:00
Jan Bouwhuis d53d59eb6c
Improve warning messages on invalid received modes (#77909) 2022-09-09 11:12:09 +02:00
GitHub Action 718d4ac6cc [ci skip] Translation update 2022-09-09 00:28:55 +00:00
epenet ff356205bf
Use platform constants from root (#78032) 2022-09-08 12:24:45 +02:00
Erik Montnemery b21f8c9ea8
Remove use of deprecated SUPPORT_* constants from MQTT light (#77828)
* Remove use of deprecated SUPPORT_* constants from MQTT light

* Refactor
2022-09-08 11:21:46 +02:00
epenet f62fbbe524
Use _attr_force_update in mqtt (#77902) 2022-09-07 23:42:16 +02:00
GitHub Action 4f7ad27b65 [ci skip] Translation update 2022-09-07 00:27:56 +00:00
epenet 6355e682fa
Improve entity type hints [m] (#77816) 2022-09-05 10:59:36 +02:00
GitHub Action 6921583410 [ci skip] Translation update 2022-09-04 00:28:06 +00:00
Jan Bouwhuis 2e34814d7a
Fix reload of MQTT config entries (#76089)
* Wait for unsubscribes

* Spelling comment

* Remove notify_all() during _register_mid()

* Update homeassistant/components/mqtt/client.py

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

* Correct handling reload manual set up MQTT items

* Save and restore device trigger subscriptions

* Clarify we are storing all remaining subscriptions

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-09-02 18:54:20 +02:00
GitHub Action ccef03f1d4 [ci skip] Translation update 2022-09-02 00:25:46 +00:00
Erik Montnemery 14717951c3
Support configuring the mode of MQTT number entities (#77478)
* Support configuring the mode of MQTT number entities

* Use modern schema for tests

Co-authored-by: jbouwh <jan@jbsoft.nl>
2022-08-30 12:47:35 +02:00
GitHub Action 035cd16a95 [ci skip] Translation update 2022-08-30 00:30:17 +00:00
GitHub Action 7f1a203721 [ci skip] Translation update 2022-08-28 00:29:27 +00:00
GitHub Action c916fcb2c6 [ci skip] Translation update 2022-08-27 00:24:30 +00:00
epenet dff9baf880
Use _attr_should_poll in components [j-n] (#77357) 2022-08-26 21:19:37 +02:00
GitHub Action d7724235ff [ci skip] Translation update 2022-08-26 00:27:16 +00:00
Jan Bouwhuis 5d9e462118
Add repair for deprecated MQTT yaml config (#77174)
* Add repair for deprecated MQTT yaml config

* Update homeassistant/components/mqtt/strings.json

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

* Update homeassistant/components/mqtt/strings.json

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Add restart instruction

* Update homeassistant/components/mqtt/strings.json

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update English translation

* update issue_registry imports

* Update homeassistant/components/mqtt/manifest.json

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-08-25 13:30:05 +02:00
Maciej Bieniek ad6beac535
Add `hw_version` to MQTT device info (#77210)
* Add hw_version

* Add abbreviation for hw_version

* Update tests

* Update discovery tests
2022-08-25 11:55:33 +02:00
Jan Bouwhuis be2366d773
Add `this` object to MQTT templates (#77142)
* Add `this` object to MQTT templates

* Only set once, remove hass guard

* Set once if there is a state

* Add tests TemplateStateFromEntityId calls once
2022-08-23 08:43:07 +02:00
Jan Bouwhuis 90aba6c523
Add cv.deprecated to MQTT modern schema's too (#76884)
Add cv.deprcated to modern schema too
2022-08-19 11:12:47 +02:00
Erik Montnemery 60c8d95a77
Remove white_value support from light (#76926) 2022-08-18 08:21:05 -04:00
Erik Montnemery 4cc1428eea
Add support for color_mode white to MQTT JSON light (#76918) 2022-08-17 13:07:50 +02:00
Erik Montnemery 73001e29ff
Remove deprecated white_value support from MQTT light (#76848)
* Remove deprecated white_value support from MQTT light

* Remove deprecated white_value support from MQTT JSON light

* Remove deprecated white_value support from MQTT template light
2022-08-16 16:47:21 +02:00
Marc Mueller af002d9dc4
Use TriggerActionType [core, l-m] (#76806) 2022-08-15 17:39:55 +02:00
Jan Bouwhuis 161e533c5f
Remove MQTT climate support for hold and away modes (#76299)
Remove support for hold and away modes
2022-08-15 08:27:37 +02:00
Jan Bouwhuis f72cfef7be
Fix MQTT camera encoding (#76124)
* Fix MQTT camera encoding

* Reduce code

* Add test for using image_encoding parameter

* Move deprecation check to validation

* Dependency

* Set correct strings and log warning

* Rename constant

* Use better issue string identifier

* Revert unwanted change to hassio test

* Avoid term `deprecated` in issue description

* Revert changes using the repairs API

* Add a notice when work-a-round will be removed

* Update homeassistant/components/mqtt/camera.py

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

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-08-15 08:26:17 +02:00
GitHub Action bec8e544f4 [ci skip] Translation update 2022-08-14 00:25:47 +00:00
Marc Mueller cf7c716bda
Fix implicit Optional [core] (#76719) 2022-08-13 18:46:08 +02:00
GitHub Action 6e03b12a93 [ci skip] Translation update 2022-08-13 00:25:00 +00:00
J. Nick Koston eeb9a9f058
Make sure all discovery flows are using the helper (#76641) 2022-08-12 09:25:23 -04:00
GitHub Action 7c81f790a7 [ci skip] Translation update 2022-08-12 00:23:47 +00:00
GitHub Action 519d478d61 [ci skip] Translation update 2022-08-11 00:26:23 +00:00
epenet c8f11d65d2
Improve type hints in demo and mqtt number entity (#76464) 2022-08-11 00:10:28 +02:00