Commit Graph

1483 Commits (a00c1fa24188c6ddaf7cec107b6d8b56ca1315d2)

Author SHA1 Message Date
Marc Mueller 1d2c2d2055
Move SignalTypes to util (#114236) 2024-03-27 08:41:44 +01:00
Marc Mueller eb81a4204e
Allow string formatting for dispatcher SignalType (#114174) 2024-03-26 10:38:29 +01:00
Joost Lekkerkerker 6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Marc Mueller 9b7cc088be
Fix spelling [runtime] (#114169) 2024-03-25 11:32:50 +01:00
Marc Mueller 1dbc94162d
Update byte string formatting (2) (#114039) 2024-03-23 00:22:15 +01:00
Jan Bouwhuis 3dc8df2403
Get ServiceValidationError message from translation cache only (#113704)
* Get ServiceValidationError message from translation cache only

* Remove message for NotValidPresetModeError
2024-03-18 14:42:21 +01:00
Jan Bouwhuis 554aefed42
Generate HomeAssistantError message from English translations (#113305)
* Fetch exception message from translation cache

* Improve tests

* Return translation key without path, cleanup

* Fetch translations when string variant is requested

* Move import

* revert changes ConfigValidationError

* mypy

* Remove _str__ method instead

* Type _message for mqtt template exception classes

* Revert changes made to test_config.py

* Undo changes TemplateError

* Follow up comments and test coverage
2024-03-16 22:56:48 +01:00
Sid 6ee273a548
Clean up unneeded ruff noqa directives (#113616) 2024-03-16 09:48:37 -10:00
Sid ccd2e989c3
Enable ruff RUF005 and fix occurrences (#113589) 2024-03-16 07:37:20 -10:00
Jan Bouwhuis 488dae43d4
Improve lists for MQTT integration (#113184)
* Improve lists for MQTT integration

* Extra diagnostics tests

* Revert changes where the original version was probably faster

* Revert change to gather and await in series
2024-03-13 11:04:59 +01:00
Jan Bouwhuis e28d4f0eae
Validate state_class with last_reset_value_template for mqtt sensors (#113099) 2024-03-12 09:08:03 +01:00
Joost Lekkerkerker 2792a5f016
Enable even more SIM ruff rules (#113017)
* SIM202 SIM211 SIM220 SIM221 SIM222 SIM223

* SIM910 SIM911

* SIM

* Update homeassistant/components/mqtt/siren.py

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

* Update homeassistant/components/mqtt/siren.py

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

---------

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2024-03-11 14:23:52 +01:00
Jan Bouwhuis 17aa49410b
Rename mqtt platform setup method (#113042)
* Rename mqtt platform setup method

* Format method to one line
2024-03-11 09:43:47 +01:00
Joost Lekkerkerker cddce0ce0d
Enable more SIM ruff rules (#113015)
* SIM101 SIM103

* SIM107 SIM109

* SIM110

* SIM112 SIM113

* SIM115

* SIM116

* Fix

* Fix

* Fix
2024-03-10 23:20:37 -04:00
Jan Bouwhuis c608d1cb85
Fix mqtt platform setup race (#112888) 2024-03-10 08:36:17 -10:00
Jan Bouwhuis caaa03536b
Cleanup mqtt PLATFORMS constant and CI-test platform filters (#112847) 2024-03-09 23:48:54 +01:00
Jan Bouwhuis 3b0ea52167
Allow Just-in-Time platform setup for mqtt (#112720)
* Allow Just-in-Time platform setup for mqtt

* Only forward the setup of new platforms

* Fix new  platforms being setup at reload + test

* Revert not related changes

* Remove unused partial

* Address comments, only import plaforms if needed

* Apply suggestions from code review

* Add multipl platform discovery test

* Improve test

* Use a lock per platform
2024-03-09 21:55:00 +01:00
Jan Bouwhuis 6534943837
Revert "Cleanup mqtt discovery code" (#112818)
Revert "Cleanup mqtt discovery code (#112749)"

This reverts commit 87318c9111.
2024-03-09 12:54:10 +01:00
Jan Bouwhuis 87318c9111
Cleanup mqtt discovery code (#112749)
* Cleanup mqtt discovery code

* Cleanup mqtt discovery code
2024-03-09 11:54:27 +01:00
Marc Mueller cef20506dc
Replace EventType with Event [missing] (#112753) 2024-03-08 21:56:42 +01:00
Marc Mueller 84c44c1835
Replace EventType with Event [l-s] (#112741) 2024-03-08 19:37:18 +01:00
Marc Mueller 2c06d4fcb9
Add empty line after module docstring (2) [components] (#112736) 2024-03-08 19:15:59 +01:00
Paulus Schoutsen f416d67d21
Remove built-in support for import_executor in manifest (#112725) 2024-03-08 12:02:32 -05:00
Marc Mueller 59a6035d3f
Add empty line after module docstring [j-m] (#112700) 2024-03-08 09:01:29 -05:00
J. Nick Koston 7dcf275966
Speed up importing mqtt platforms (#112682)
Use async_forward_entry_setups so platforms can be loaded in a single
executor job instead of many:

Currently they all have to create a new job because it did not use
async_forward_entry_setups

```
2024-03-08 08:29:29.819 DEBUG (MainThread) [homeassistant.loader] Importing platforms for mqtt executor=[light] loop=[] took 12.12s
2024-03-08 08:29:29.822 DEBUG (MainThread) [homeassistant.loader] Importing platforms for mqtt executor=[number] loop=[] took 12.12s
2024-03-08 08:29:29.826 DEBUG (MainThread) [homeassistant.loader] Importing platforms for mqtt executor=[scene] loop=[] took 12.13s
2024-03-08 08:29:29.829 DEBUG (MainThread) [homeassistant.loader] Importing platforms for mqtt executor=[select] loop=[] took 12.13s
2024-03-08 08:29:29.833 DEBUG (MainThread) [homeassistant.loader] Importing platforms for mqtt executor=[sensor] loop=[] took 12.14s
2024-03-08 08:29:30.882 DEBUG (MainThread) [homeassistant.loader] Importing platforms for mqtt executor=[update] loop=[] took 13.18s
2024-03-08 08:29:30.948 DEBUG (MainThread) [homeassistant.loader] Importing platforms for mqtt executor=[button] loop=[] took 13.18s
2024-03-08 08:29:30.949 DEBUG (MainThread) [homeassistant.loader] Importing platforms for mqtt executor=[climate] loop=[] took 13.19s
2024-03-08 08:29:31.012 DEBUG (MainThread) [homeassistant.loader] Importing platforms for mqtt executor=[fan] loop=[] took 13.25s
2024-03-08 08:29:31.019 DEBUG (MainThread) [homeassistant.loader] Importing platforms for mqtt executor=[humidifier] loop=[] took 13.25s
2024-03-08 08:29:31.024 DEBUG (MainThread) [homeassistant.loader] Importing platforms for mqtt executor=[image] loop=[] took 13.26s
2024-03-08 08:29:31.034 DEBUG (MainThread) [homeassistant.loader] Importing platforms for mqtt executor=[lock] loop=[] took 13.27s
2024-03-08 08:29:31.045 DEBUG (MainThread) [homeassistant.loader] Importing platforms for mqtt executor=[vacuum] loop=[] took 13.28s
2024-03-08 08:29:31.050 DEBUG (MainThread) [homeassistant.loader] Importing platforms for mqtt executor=[valve] loop=[] took 13.28s
```
2024-03-08 10:30:31 +01:00
Joost Lekkerkerker c8f39911cc
Enable some PERF rules (#112498)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-03-06 17:50:41 +01:00
Jan Bouwhuis 0c2cf881ac
Deprecate old config options for MQTT json light (#111676)
* add deprecaction

* Deprecate old config options for mqtt json light

* Do not deprecate brightness flag

* Enable brightness support by default

* Keep `false` as default for brightness flag

* Add warnings and register issue

* log warning and register on use of color_mode flag

* Remove redundant cv.deprecated logging + follow up comments
2024-03-05 08:49:05 +01:00
Jan Bouwhuis c13231fc00
Improve mqtt value template error logging (#110492)
* Refactor mqtt value template error logging

* Remove import
2024-03-04 08:49:12 +01:00
Joost Lekkerkerker 0daa860e94
Add icon translations to MQTT (#111945) 2024-03-01 20:16:11 +01:00
Erik Montnemery 52e7912caf
Migrate integrations i-m to generic flowhandler (#111863) 2024-02-29 20:08:46 +01:00
J. Nick Koston 359bd625c8
Import mqtt in the executor to avoid blocking the event loop (#111521) 2024-02-26 11:41:07 -10:00
Jan Bouwhuis 1b2e669302
Improve handling mqtt command template exceptions (#110499)
* Improve handling mqtt command template exceptions

* Fix test

* Cleanup stale exception handler

* Throw on topic template exception
2024-02-26 11:04:55 +01:00
Jan Bouwhuis afa4e76248
Optimize mqtt device cleanup (#111170)
Thnx
2024-02-23 07:29:50 +01:00
Jan Bouwhuis 09f1ec78a5
Handle template errors on MQTT payload handling (#110180)
* Handle template errors on MQTT payload handling (alt)

* Handle mqtt event en image template errors correctly
2024-02-13 10:59:55 +01:00
Jan Bouwhuis 545a34a849
Remove power_state_template from mqtt climate value template list (#110452) 2024-02-13 09:16:11 +01:00
Jan Bouwhuis 00947b708f
Remove aux heat support from mqtt climate (#109513) 2024-02-06 09:37:39 +01:00
Marc Mueller bf8bd5ff21
Use dict.get instead of inline if (#109693) 2024-02-05 13:56:10 +01:00
Marc Mueller a9147cf3dd
Use builtin TimeoutError [k-n] (#109681) 2024-02-05 12:08:18 +01:00
G Johansson 5b9a3d5bd5
Add migrated ClimateEntityFeature to MQTT (#109419) 2024-02-03 12:08:58 +01:00
J. Nick Koston 5c3bf13ca4
Only decode msg topic once when handling mqtt payloads (#109258) 2024-02-01 03:42:58 +01:00
Jan Bouwhuis 04f0128a1c
Simplify MQTT device triggers in automations (#108309)
* Simplify MQTT device trigger

* Add test non unique trigger_id

* Adjust deprecation warning

* Make discovery_id optional

* refactor double if

* Improve validation, add tests and deprecation comments

* Avoid breaking change

* Inmprove error message

* Match on discovery_id instead of discovery_info

* Revert an unrelated change

* follow up comments

* Add comment and test on device update with non unique trigger

* Update homeassistant/components/mqtt/device_trigger.py

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

* Update homeassistant/components/mqtt/device_trigger.py

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

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-01-30 20:50:39 +01:00
Jan Bouwhuis 6023980c2e
Set TURN_ON and TURN_OFF feature on MQTT climate entities (#109146) 2024-01-30 19:35:46 +01:00
Jan Bouwhuis 677b06f502
Add comment to explain not using the core API in MQTT client (#108942) 2024-01-27 02:05:31 -10:00
Jan Bouwhuis 7bec5ef6bc
Use unknown color_mode for MQTT json lights if color mode is not set (#108909) 2024-01-26 14:42:47 +01:00
Jan Bouwhuis 26058bf922
Add serial_number attribute to MQTT device properties (#108105) 2024-01-16 14:02:34 +01:00
Jan-Philipp Benecke 28281523ec
Add pylint plugin to check for sorted platforms list (#108115) 2024-01-16 09:47:53 +01:00
J. Nick Koston 4b7a313ece
Use identity checks for CoreState (#107846)
Some of the checks used ==, and some used is. Switch
everything to is as its faster
2024-01-12 10:21:26 +01:00
Jan Bouwhuis e0457590d1
Fix mqtt text text min max config params can not be equal (#107738)
Fix mqtt text text min max kan not be equal
2024-01-11 07:17:48 +01:00
Jan Bouwhuis 9ad3c8dbc9
Remove MQTT legacy vacuum support (#107274) 2024-01-08 09:22:43 +01:00
Jan-Philipp Benecke c81f909ee3
Use call_soon_threadsafe in mqtt client unsubscribe callback (#107266) 2024-01-05 19:45:56 +01:00