Commit graph

300 commits

Author SHA1 Message Date
Erik Montnemery
9b21a48048
Mend incorrectly imported MQTT config entries ()
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-04-01 08:11:31 -07:00
Marc Mueller
911b159281
Cleanup after pylint update () 2022-03-26 00:34:12 +01:00
Jan Bouwhuis
5afe8fd2db
Revert "Add MQTT notify platform ()" ()
This reverts commit e574a3ef1d.
2022-03-22 12:51:24 +01:00
Jan Bouwhuis
c8fb86a8ed
Fix MQTT false positive deprecation warnings () 2022-03-14 12:39:44 +01:00
Erik Montnemery
e5523ef6b6
Correct local import of paho-mqtt ()
* Correct local import of paho-mqtt

* Remove MqttClientSetup.mqtt class attribute

* Remove reference to MqttClientSetup.mqtt
2022-03-10 10:32:49 +01:00
Jan Bouwhuis
e574a3ef1d
Add MQTT notify platform ()
* Mqtt Notify service draft

* fix updates

* Remove TARGET config parameter

* do not use protected attributes

* complete tests

* device support for auto discovery

* Add targets attribute and support for data param

* Add tests and resolve naming issues

* CONF_COMMAND_TEMPLATE from .const

* Use mqtt as default service name

* make sure service  has a unique name

* pylint error

* fix type error

* Conditional device removal and test

* Improve tests

* update description has_notify_services()

* Use TypedDict for service config

* casting- fix discovery - hass.data

* cleanup

* move MqttNotificationConfig after the schemas

* fix has_notify_services

* do not test log for reg update

* Improve casting types

* Simplify obtaining the device_id

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

* await not needed

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

* Improve casting types and naming

* cleanup_device_registry signature change and black

* remove not needed condition

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-03-08 16:27:18 +01:00
Jan Bouwhuis
5ab4b5d15a
MQTT Improve warning override deprecated settings () 2022-03-04 12:39:29 +01:00
Jan Bouwhuis
9356bf1a8e
Fix MQTT config flow with advanced parameters ()
* Fix MQTT config flow with advanced parameters

* Add test
2022-03-03 21:40:15 +01:00
Jan Bouwhuis
a97fe7aae0
Mqtt fix issue with displaying non UTF-8 payload ()
* Mqtt fix issue with displaying non UTF-8 payload

* None or binary

* Casting and additional test

* casting
2022-03-02 17:01:47 +01:00
Erik Montnemery
5e4b16c69a
Remove custom WS command for removing MQTT devices ()
* Remove custom WS command for removing MQTT devices

* Re-add removed test
2022-02-28 15:50:49 +01:00
Erik Montnemery
c7d59bb272
Fix race when unsubscribing from MQTT topics ()
* Fix race when unsubscribing from MQTT topics

* Improve test
2022-02-28 14:19:50 +01:00
Franck Nijhof
21f3e5ef13
Fix MQTT config entry deprecation warnings () 2022-02-24 18:14:38 +01:00
Erik Montnemery
c879bf295b
Deprecate manual MQTT configuration available in config flow () 2022-02-23 09:41:44 +01:00
Marc Mueller
45d8d04c40
Use assignment expressions [other] () 2022-02-19 17:22:51 +01:00
Erik Montnemery
ba6d1976df
Improve MQTT device removal ()
* Improve MQTT device removal

* Update homeassistant/components/mqtt/mixins.py

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

* Adjust tests

* Improve test coverage

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-02-18 13:45:25 +01:00
Erik Montnemery
cd00464285
Remove use of hass.helpers from MQTT ()
* Remove use of hass.helpers from MQTT

* Tweak
2022-02-17 23:18:03 +01:00
Erik Montnemery
750b48dcaf
Use pylint disable-next in MQTT () 2022-02-17 11:12:12 -08:00
Erik Montnemery
335a918118
Create MQTT discovery flow when manual config is present ()
* Create MQTT discovery flow when manual config is present

* Change to integration_discovery flow

* Add test

* Add default handler for integration_discovery
2022-02-11 10:31:51 +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
Erik Montnemery
da38d9ab80
Fix MQTT debug info () 2022-02-09 09:43:03 +01:00
Erik Montnemery
55d8314093
Fix cleanup of MQTT debug info () 2022-02-08 12:49:25 -08:00
Erik Montnemery
8245ff7473
Log transmitted MQTT messages () 2022-02-04 17:35:32 +01:00
Jan Bouwhuis
6fdaec0847
Add MQTT siren platform ()
* Add mqtt siren draft

* fix tests

* Intergrate notify platform

* tests and fixes siren platform

* Add tests notify platform

* config parameters and abbreviations

* remove duplicate key

* undo move topic abbreviation

* Move const CONF_MESSAGE_COMMAND_TEMPLATE

* Remove notify service integration

* Rework

* Update homeassistant/components/mqtt/siren.py

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

* Publish JSON by default

* Allow unknown state - rename value_template

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-01-31 10:31:57 +01:00
Jan Bouwhuis
8b30751839
MQTT Remove unused and not tested code () 2022-01-20 13:47:46 +01:00
Marc Mueller
67c35652f0
Update typing - collections.abc (2) () 2022-01-12 09:04:37 +01:00
Marc Mueller
945b67c5c5
Fix 3rd party imports () 2022-01-05 19:00:47 +01:00
Marc Mueller
b168a8c7d0
Use imports from helpers.typing () 2022-01-05 14:56:34 +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
061ce0c187
Fix mqtt reloading and rework tests ()
* 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
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
33e926371f
Add init type hints [m] ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-02 16:28:14 +01:00
Sebastian Lövdahl
d18f1cc872
Use Platform constants all over the place 2/3 () 2021-12-28 21:23:07 +01:00
epenet
8cc0df7b72
Ensure service calls are typed [k-n] ()
* Ensure service calls are typed [k-n]

* Ensure service calls are typed in mazda

* Adjust mazda

* Add mazda comment

Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-28 14:33:08 +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
epenet
da7c5f4722
Break long lines in discovery_info () 2021-12-10 12:48:47 +01:00
epenet
c05eca1c82
Remove log flooding prevention logic from discovery info ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-08 10:28:26 -10:00
epenet
b65b25c1bb
Move MqttServiceInfo to init.py ()
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
Jan Bouwhuis
2a2a20fcb3
Add mqtt sensor configurable state encoding for sensor and binary_sensor platform ()
* 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
Robert Hillis
16027b9f43
Fix mqtt undefined error () 2021-11-16 17:16:24 +01:00
David Beitey
1bcd62cd32
Add topic_template for mqtt.publish ()
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
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
Marc Mueller
487fa0a905
Use assignment expressions 20 () 2021-10-20 20:31:00 +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
4d7e3cde5a
Minor cleanup and test coverage improvement for MQTT () 2021-09-27 17:45:52 +02:00
Marc Mueller
10bfc78365
Fix missing encoding with open() ()
* Fix missing encoding with open()

* Fix tests

* Improve open - frontend
2021-07-28 09:41:45 +02:00
Jan Bouwhuis
c9eab10134
Add MQTT humidifier platform integration ()
* New mqtt humidifier platform

* Add humidifier platform

* Leave out humidity step

* Use humidity in constant for payload reset

* change TARGET_HUMIDITY_RESET payload name

* _attr_max_humidity not assigned correctly

* _target_humidity_range has a zero base

* align CONF_TARGET_HUMIDITY_MIN and MAX  with model

* shorter topics for humidity_range

* Converts float to int from template

* new humidifier abbreviations

* Add common module to support tests

* Add tests

* Addtional testing

* Always require target_humidity_command_topic

* Typo

* use available_modes to align entity model

* use avail_modes not modes to avoid conflict

* typo target_humidity_value_template

* Allign modes and templates with climate platform

* mode_state_template

* target_humidity_state_template

* Typo in platform name

* Remove humidity_range feature and common lib

* Update homeassistant/components/mqtt/humidifier.py

Use vol.In, not regex

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

* black

* Update homeassistant/components/mqtt/humidifier.py

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

* Use round to convert float to target humidity

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-07-15 11:12:23 +02:00
Erik Montnemery
4d32e1ed01
Minor improvements of MQTT typing ()
* Minor improvements of MQTT typing

* Tweak
2021-07-06 14:38:48 +02:00
Erik Montnemery
79ee112490
Enable basic type checking for mqtt ()
* Enable basic type checking for mqtt

* Tweak
2021-07-05 10:33:12 +02:00