Commit Graph

1430 Commits (bd4177edc804af96b27e9ed84fa35cd401e213ac)

Author SHA1 Message Date
Jan Bouwhuis dae8c0fc38
Fix MQTT retained event messages should be discarded (#106425) 2023-12-27 12:48:53 +01:00
Franck Nijhof 68ac4717dc
Revert "Raise HomeAssistantError if event is triggered with invalid event_type" (#106458) 2023-12-27 10:22:37 +01:00
Jan Bouwhuis 65e8bbacc9
Raise HomeAssistantError if event is triggered with invalid event_type (#106357) 2023-12-27 08:50:46 +01:00
J. Nick Koston 6d14c265b4
Ensure MQTT attributes are bound to the respective platform entity (#106316) 2023-12-23 10:39:25 -10:00
Jan Bouwhuis 6da2f98d34
Fix mqtt valve is not resetting opening or closing state (#106240)
* Fix mqtt valve is not resetting opening or closing state

* Require state or position attr in JSON state update

* Do not change `_attr_is_closed` if valve reports a position

* Add comment, use tuple

* Call _update_state
2023-12-23 15:18:44 +01:00
Jan Bouwhuis f263da843a
Fix typo's en and improve language on MQTT data descriptions (#106165)
* Fix typo's en and prove language on MQTT data descriptions

* Update homeassistant/components/mqtt/strings.json

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/mqtt/strings.json

* Update homeassistant/components/mqtt/strings.json

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
2023-12-21 12:32:24 +01:00
Jan Bouwhuis f8f31627ce
Refactor ranging utils for mqtt cover (#105739)
* Refactor ranging utils for mqtt cover

* Use literals for default min and max percentage
2023-12-21 11:54:05 +01:00
Ville Skyttä 24b1e01d71
Update Ruff to 0.1.8, avoid linter/formatter conflicts (#106080)
* Disable Ruff rules that may conflict with the formatter

* Upgrade Ruff to 0.1.8

- https://github.com/astral-sh/ruff/releases/tag/v0.1.7
- https://github.com/astral-sh/ruff/releases/tag/v0.1.8

* Format with Ruff 0.1.8
2023-12-20 23:55:09 +01:00
Jan Bouwhuis 65d3f7e1c7
Improve error mqtt valve error logging (#106129)
* Improve error mqtt valve error logging

* Update homeassistant/components/mqtt/valve.py

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

* Update homeassistant/components/mqtt/valve.py

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

* Update homeassistant/components/mqtt/valve.py

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

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-12-20 21:18:30 +01:00
Jan Bouwhuis c7f6ab2457
Add MQTT valve platform (#105766)
* Add mqtt valve platform

* No stop topic-reports_position and validation

* Do not allow state_open, state_closed with position reporing valve

* Allow open/close feature to be disabled

* Follow up comments

* Rename

* Apply defaults in validator

* Update docstr
2023-12-20 07:49:49 +01:00
Jan Bouwhuis b4741c2069
Add data descriptions to MQTT config flow. (#105301)
* Add data descriptions to MQTT config flow.

* Remove keep allive, correct text CA cert
2023-12-15 16:30:54 +01:00
Erik Montnemery 9020dbb093
Remove context_recent_time property from entity base class (#105652) 2023-12-14 08:33:31 +01:00
Marc Mueller b71f488d3e
Update pylint to 3.0.3 (#105491) 2023-12-11 17:04:07 +01:00
Jan Bouwhuis e5a115ce1f
Fix mqtt json light state updates using deprecated color handling (#105283) 2023-12-08 16:54:02 +01:00
Jan Bouwhuis e8475b9b33
Add scaling utils for brightness and fanspeed (#104753)
Co-authored-by: Robert Resch <robert@resch.dev>
2023-12-04 12:10:58 +01:00
Jan Bouwhuis 4bf88b1690
Improve MQTT json light brightness scaling (#104510)
* Improve MQTT json light brightness scaling

* Revert unrelated changes

* Format
2023-11-29 16:42:10 +01:00
Jan Bouwhuis 82264a0d6b
Fix mqtt cover state is open after receiving stopped payload (#104726) 2023-11-29 16:29:42 +01:00
Jan Bouwhuis 953a212dd6
Use ServiceValidationError for invalid fan preset_mode and move check to fan entity component (#104560)
* Use ServiceValidationError for fan preset_mode

* Use _valid_preset_mode_or_raise to raise

* Move preset_mode validation to entity component

* Fix bond fan and comments

* Fixes baf, fjaraskupan and template

* More integration adjustments

* Add custom components mock and test code

* Make NotValidPresetModeError subclass

* Update homeassistant/components/fan/strings.json

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

* Keep bond has_action validation

* Move demo test asserts outside context block

* Follow up comment

* Update homeassistant/components/fan/strings.json

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

* Fix demo tests

* Remove pylint disable

* Remove unreachable code

* Update homeassistant/components/fan/__init__.py

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

* Use NotValidPresetModeError, Final methods

* Address comments

* Correct docst

* Follow up comments

* Update homeassistant/components/fan/__init__.py

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

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-11-29 13:56:51 +01:00
Aarni Koskela 706add4a57
Switch formatting from black to ruff-format (#102893)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-11-27 14:38:59 +01:00
Jan Bouwhuis 8a1f7b6802
Add translation key for some mqtt exceptions (#104550) 2023-11-26 17:33:54 +01:00
Jan Bouwhuis af71c2bb45
Raise and suppress stack trace when reloading yaml fails (#102410)
* Allow async_integration_yaml_config to raise

* Docstr - split check

* Implement as wrapper, return dataclass

* Fix setup error handling

* Fix reload test mock

* Move log_messages to error handler

* Remove unreachable code

* Remove config test helper

* Refactor and ensure notifications during setup

* Remove redundat error, adjust tests notifications

* Fix patch

* Apply suggestions from code review

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

* Follow up comments

* Add call_back decorator

* Split long lines

* Update exception abbreviations

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-11-24 17:34:45 +01:00
Jan Bouwhuis 68f8b2cab5
Fix mqtt json light allows to set brightness value >255 (#104220) 2023-11-19 19:50:25 +01:00
Erik Montnemery d8a49b14e5
Use relative paths in configuration validation error messages (#104064) 2023-11-16 10:56:47 +01:00
Erik Montnemery 5b37096b5f
Refactor config.async_log_exception (#104034)
* Refactor config.async_log_exception

* Improve test coverage

* Make functions public
2023-11-15 19:09:49 +01:00
Jan Bouwhuis 7ca264e746
Fix raising vol.Invalid during mqtt config validation instead of ValueError (#103764) 2023-11-13 22:59:03 +01:00
Jan Bouwhuis db97e7588b
Fix entity category for binary_sensor fails setup (#103511) 2023-11-08 14:10:24 +01:00
Jan Bouwhuis cbccdbc6fa
Fix entity category for sensor fails mqtt sensor platform setup (#103449) 2023-11-08 00:03:47 +01:00
Jan Bouwhuis 54cf7010cd
Add ServiceValidationError and translation support (#102592)
* Add ServiceValidationError

* Add translation support

* Extend translation support to HomeAssistantError

* Add translation support for ServiceNotFound exc

* Frontend translation & translation_key from caller

* Improve fallback message

* Set websocket_api as default translation_domain

* Add MQTT ServiceValidationError exception

* Follow up comments

* Revert removing gueard on translation_key

* Revert test changes to fix CI test

* Follow up comments

* Fix CI test

* Follow up

* Improve language

* Follow up comment
2023-11-06 15:45:04 +01:00
Jan Bouwhuis 4a4d2ad743
Fix mqtt config validation error handling (#103210)
* Fix MQTT config check

* Fix handling invalid enity_category for sensors

* Improve docstr

* Update comment

* Use correct util for yaml dump
2023-11-02 10:57:00 +01:00
Jan Bouwhuis daee5baef6
Fix mqtt is not reloading without yaml config (#103159) 2023-11-01 09:25:56 +01:00
Jirka 422af9d438
Update MQTT QoS description string (#103036)
Update strings.json
2023-10-30 09:54:46 +01:00
Jan Bouwhuis 8eaf38cd44
Fix mqtt schema import not available for mqtt_room (#102866) 2023-10-27 10:51:45 +02:00
Jan Bouwhuis 973b8900a9
Optimize mqtt platform setup (#102449)
* Optimize mqtt platform setup and correct issue

* Avoid coroutine for setup entity from discovery

* Avoid extra check

* Revert string constants

* Add comment
2023-10-22 08:31:08 +02:00
Jan Bouwhuis 242124504b
Improve mqtt config issue string constants (#102496)
Improve config issue string constants
2023-10-22 00:21:55 +02:00
Jan Bouwhuis 1bd0b2d05f
Refactor mqtt entity cleanup on reload (#102375) 2023-10-20 20:28:04 +02:00
Jan Bouwhuis 485c52568d
Fix error handling on subscribe when mqtt is not initialized (#101832) 2023-10-20 15:16:45 +02:00
Jan Bouwhuis 25ab622b51
Rename mqtt entry setup helpers to reflect their purpose (#102378)
Rename mqtt entry setup helpers
2023-10-20 13:36:24 +02:00
Jan Bouwhuis 7d9014ae41
Do not fail MQTT setup if events or sensors configured via yaml can't be validated (#102309)
* Add event and sensor

* Cleanup unused code

* Schema cannot be None for supported platform
2023-10-20 12:09:52 +02:00
Jan Bouwhuis 1efbba2631
Do not fail MQTT setup if covers configured via yaml can't be validated (#102304)
Add cover
2023-10-20 10:51:42 +02:00
Jan Bouwhuis 12c4a10cfc
Do not fail MQTT setup if numbers configured via yaml can't be validated (#102316)
Add number
2023-10-20 10:51:14 +02:00
Jan Bouwhuis f1eb28b7ac
Do not fail MQTT setup if update entities configured via yaml can't be validated (#102324) 2023-10-20 10:14:25 +02:00
Jan Bouwhuis c7b1e4186b
Do not fail MQTT setup if water heaters configured via yaml can't be validated (#102326) 2023-10-20 08:15:09 +02:00
Jan Bouwhuis 04fdcbe5fa
Do not fail MQTT setup if buttons configured via yaml can't be validated (#102301) 2023-10-20 08:13:59 +02:00
Jan Bouwhuis dcdd4b470c
Do not fail MQTT setup if lawn mowers configured via yaml can't be validated (#102314) 2023-10-20 08:11:33 +02:00
Jan Bouwhuis 5264cdf382
Do not fail MQTT setup if locks configured via yaml can't be validated (#102315)
Add lock
2023-10-20 01:13:35 +02:00
Jan Bouwhuis f4e7c5aed3
Do not fail MQTT setup if humidifiers configured via yaml can't be validated (#102312)
Add humidifier
2023-10-19 23:29:49 +02:00
Jan Bouwhuis ec1b3fe6fb
Do not fail MQTT setup if switches configured via yaml can't be validated (#102320)
Add switch
2023-10-19 23:04:35 +02:00
Jan Bouwhuis 54c80491e3
Do not fail MQTT setup if select's configured via yaml can't be validated (#102318)
Add select
2023-10-19 22:10:45 +02:00
Jan Bouwhuis e26a2596af
Do not fail MQTT setup if climate's configured via yaml can't be validated (#102303)
Add climate
2023-10-19 21:14:45 +02:00
Jan Bouwhuis 22c21fdc18
Do not fail MQTT setup if vacuum's configured via yaml can't be validated (#102325)
Add vacuum
2023-10-19 20:11:09 +02:00