1
mirror of https://github.com/home-assistant/core synced 2024-10-04 07:58:43 +02:00
Commit Graph

77 Commits

Author SHA1 Message Date
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
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
Jan Bouwhuis
5930f056a8
Mqtt support config_entry unload (#70149)
* squashed commits for rebase

* Flake

* Fix reloading issue manual legacy items

* Improve ACS sync for unsubscribe at disconnect

* Processed review comments

* Update homeassistant/components/mqtt/client.py

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

* No need to await entry setup

* Remove complication is_connected

* Update homeassistant/components/mqtt/__init__.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-07-12 11:07:18 +02:00
Erik Montnemery
f05b4a0ca0
Fire event_mqtt_reloaded only after reload is completed (#74226) 2022-06-30 10:15:25 -07:00
epenet
3c82c718cb
Improve typing in fans and locks (#73901) 2022-06-23 16:34:40 +02:00
epenet
48bd7cf5e1
Add missing ToggleEntity type hints in fans (#73887) 2022-06-23 12:01:05 +02:00
epenet
6b6e5fad3c
Add missing type hints in fans (#73835) 2022-06-22 18:43:41 +02:00
Jan Bouwhuis
57daeaa174
Fix MQTT config schema to ensure correct validation (#73619)
* Ensure config schema validation

* Use correct schema for device_tracker

* Remove schema validation from the platform setup

* Remove loop to build schema
2022-06-20 08:51:12 +02:00
Erik Montnemery
b97d346df7
Fix reload of MQTT yaml config (#72901) 2022-06-02 11:32:31 -07:00
Erik Montnemery
635d7085cf
Move MQTT config schemas and client to separate modules (#71995)
* Move MQTT config schemas and client to separate modules

* Update integrations depending on MQTT
2022-05-31 09:32:44 +02:00
Jan Bouwhuis
ed1c2ea2b8
Move manual configuration of MQTT fan and light to the integration key (#71676)
* Processing yaml config through entry setup

* Setup all platforms

* Update homeassistant/components/mqtt/__init__.py

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

* adjust mock_mqtt - reference config from cache

* Fix test config entry override

* Add tests yaml setup

* additional tests

* Introduce PLATFORM_SCHEMA_MODERN

* recover temporary MQTT_BASE_PLATFORM_SCHEMA

* Allow extra key in light base schema, restore test

* Fix test for exception on platform key

* One deprecation message per platform

* Remove deprecation checks from modern schema

* Update homeassistant/components/mqtt/fan.py

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

* Update homeassistant/components/mqtt/fan.py

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

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

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

* Update homeassistant/components/mqtt/light/__init__.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 homeassistant/components/mqtt/mixins.py

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

* rename validate_modern_schema

* Do not fail platform if a single config is broken

* Update homeassistant/components/mqtt/__init__.py

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

* Fix tests on asserting log

* Update log. Make helper transparant, remove patch

* Perform parallel processing

* Update tests/components/mqtt/test_init.py

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

* Apply suggestions from code review

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

* Update homeassistant/components/mqtt/mixins.py

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

* black

* Fix tests and add #new_format anchor

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-05-19 15:04:53 +02:00
epenet
3e426c0fa6
Use EntityFeature enum in mqtt (#69416) 2022-04-07 09:44:26 +02:00
J. Nick Koston
723dcbafca
Complete fan speed transition from #59781 (#67743) 2022-03-09 10:38:12 +01:00
Erik Montnemery
fe38e6ba87
Drop MQTT import flow (#66160)
* 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 (#65631) 2022-02-10 09:18:35 +01:00
Erik Montnemery
8245ff7473
Log transmitted MQTT messages (#65550) 2022-02-04 17:35:32 +01:00
Jan Bouwhuis
711bd7169e
Add Mqtt Fan unknown state support (#65301)
* Add Mqtt Fan unknown state support

* Update homeassistant/components/mqtt/fan.py

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

* Adjust default state in tests

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-02-03 16:48:03 +01:00
Erik Montnemery
f3a89de71f
Fix race when handling updated MQTT discovery data (#65415) 2022-02-02 17:12:22 -08:00
Jan Bouwhuis
7ea8d72133
Move CONF_COMMAND_TEMPLATE to .const (#64558) 2022-01-20 16:15:26 +01:00
Erik Montnemery
d8e7236502
Cleanup handling of unsupported config keys in MQTT fan (#62681)
* Cleanup handling of unsupported config keys in MQTT fan

* Update fan.py
2022-01-03 17:54:03 +01:00
Jan Bouwhuis
dd0193052c
Add MQTT encoding parameter for all subscribed topics (#62263)
* 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 (#62105)
* 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 (#61937)
* 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 (#62739)
* 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 (#62875)
* 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
Jan Bouwhuis
d5defa8995
Support publishing MQTT messages with raw bytes payloads (#61090)
* 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
Damien Duboeuf
67c2747027
Add MQTT object_id option (#58728)
* 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
Jan Bouwhuis
c3fc19915e
Mqtt fan fail deprecated options for classic speeds (#58992)
* Fail deprecated options

* new removed validator

* correct module_name - add tests

* Add test cant find module cv.removed

* module name from stack+1

* Remove error from log. Just throw.

* assert on thrown exception text

* cleanup formatting remove KeyStyleAdapter

* format the replacement_key and update test

* deprecated vs removed - add raise_if_present opt

* doc string update

* is deprecated
2021-11-04 17:54:27 +01:00
Erik Montnemery
0456a896e3
Avoid service call in MQTT async_publish function (#58441)
* 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 (#58390)
* Allow extra keys in MQTT discovery messages

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

* Organize common mqtt constants
2021-10-12 11:26:38 +02:00
Jan Bouwhuis
5bb9aa8f3d
Remove MQTT Fan legacy speeds (#54768)
* Remove MQTT Fan legacy speeds

* deprecated attibutes are not disruptive
2021-08-24 11:21:35 +02:00
Marc Mueller
f6b162bc39
Add pylint CodeStyle extension (#53147) 2021-07-19 06:57:06 -07:00
Erik Montnemery
e0f7987544
Filter MQTT fan JSON attributes (#52283) 2021-06-29 11:18:50 +02:00
Erik Montnemery
9097f41219
Correct comment in MQTT fan (#51682) 2021-06-10 08:18:59 +02:00
Jan Bouwhuis
9abf43f95f
Mqtt fan feature for resetting current speed percentage or preset_mode (#50565)
* Mqtt fan resetting speed percentage or preset_mode

* tests reset payload is working with val templates

* Remove duplicate line for CONF_PAYLOAD_HIGH_SPEED
2021-05-18 08:24:42 +02:00
Jan Bouwhuis
7ab505633d
Ignore empty output from MQTT fan's value template (#50122)
* Allow empty payload

* Add tests for ignoring empty payload

* logging on empty state and osccilation with tests

* Improve warning log when invalid value is received
2021-05-07 13:22:08 +02:00
J. Nick Koston
3fa8ffa731
Enable mccabe complexity checks in flake8 (#49616)
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. (#49567) 2021-04-22 14:53:37 -07:00
Jan Bouwhuis
74d7293ab8
mqtt fan percentage to speed_range and received speed_state fix (#49060)
* percentage to speed_range and get speed state fix

* Update homeassistant/components/mqtt/fan.py

* Update homeassistant/components/mqtt/fan.py

* Update homeassistant/components/mqtt/fan.py

* Update homeassistant/components/mqtt/fan.py

Co-authored-by: J. Nick Koston <nick@koston.org>
2021-04-11 13:53:07 -10:00
Jan Bouwhuis
28ad5b5514
Implement percentage_step and preset_mode is not not speed fix for MQTT fan (#48951) 2021-04-09 16:14:48 -07:00
Jan Bouwhuis
d8a4cf63f4
Command template support for MQTT fan (#48413)
* Command template support

* Fix typo in abbreviations

* Update homeassistant/components/mqtt/fan.py

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

* Fix initialize templates

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-03-29 20:41:51 +02:00
Jan Bouwhuis
5b17aaf9d5
Percentage and preset mode support for MQTT fan (#47944)
* git push --all origin

* Fix percentage to ordered list conversion

* Tests for mqtt fan and fixes

* Improve tests and error handling base config

* Additional tests

* Tests completed, small fixes

* Allow preset mode and percentages combined

* Remove raise in setup and update tests

* Alignment with fan entity mode

* Fix pylint for len-as-condition

* Remove python binary cache file from PR

* Additional tests on async_turn_on and fix

* Added comments for deprecation of speeds

* Schema checks before init

* Optimize pre schema checks

* Correct schema checks

* Update homeassistant/components/mqtt/abbreviations.py

Comment speeds for mqtt fan are deprecated not needed here

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

* Update homeassistant/components/mqtt/fan.py

Comment speeds for mqtt fan are deprecated not needed here

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

* Update homeassistant/components/mqtt/fan.py

Comment speeds for mqtt fan are deprecated not needed here

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

* Update homeassistant/components/mqtt/fan.py

Comment speeds for mqtt fan are deprecated not needed here

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

* Update homeassistant/components/mqtt/fan.py

Comment speeds for mqtt fan are deprecated not needed here

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

* Warnings for exceptions - testing speed_range

* Update homeassistant/components/mqtt/abbreviations.py

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

* Update homeassistant/components/mqtt/fan.py

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

* Update homeassistant/components/mqtt/fan.py

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

* Update homeassistant/components/mqtt/fan.py

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

* Update homeassistant/components/mqtt/fan.py

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

* Update homeassistant/components/mqtt/fan.py

* Save with black

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-03-26 08:37:47 +01:00
Kristian Heljas
9e487eb260
Hoist mqtt name property and add icon support to MqttEntity (#47165)
* 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
a5a45f29e2
Cleanup unused loggers (#46510) 2021-02-14 13:46:58 +01:00
tkdrob
b85ecc0bd2
Use core constants for mqtt (#46389) 2021-02-11 13:38:33 +01:00
J. Nick Koston
068d1b5eb8
Separate fan speeds into percentages and presets modes (#45407)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: John Carr <john.carr@unrouted.co.uk>
2021-01-27 17:44:36 -06: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
248802efd5
Add MQTT base entity (#44971) 2021-01-09 17:46:53 +01:00
Erik Montnemery
6dd6d9b368
Deduplicate MQTT entity discovery code (#44970) 2021-01-09 14:37:33 +01:00