Commit graph

873 commits

Author SHA1 Message Date
J. Nick Koston
ed0568c655
Ensure config entries are not unloaded while their platforms are setting up (#118767)
* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* run with error on to find them

* cert_exp, hold lock

* cert_exp, hold lock

* shelly async_late_forward_entry_setups

* compact

* compact

* found another

* patch up mobileapp

* patch up hue tests

* patch up smartthings

* fix mqtt

* fix esphome

* zwave_js

* mqtt

* rework

* fixes

* fix mocking

* fix mocking

* do not call async_forward_entry_setup directly

* docstrings

* docstrings

* docstrings

* add comments

* doc strings

* fixed all in core, turn off strict

* coverage

* coverage

* missing

* coverage
2024-06-04 21:34:39 -04:00
Jesse Hills
035e21ddbb
[esphome] 100% voice assistant test coverage (#118334) 2024-05-28 21:14:47 -04:00
Jesse Hills
7f530ee0e4
[esphome] Assist timers (#118275)
* [esphome] Assist timers

* Add intent to manifest dependencies

* Add test

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-28 14:57:58 -04:00
Jesse Hills
a23da3bd46
Bump aioesphomeapi to 24.5.0 (#118271) 2024-05-28 13:03:01 +12:00
Mischa Siekmann
ad69a23fda
Send MEDIA_ANNOUNCE flag to ESPHome media_player (#116993) 2024-05-23 09:47:34 +12:00
Marc Mueller
b93312b62c
Use PEP 695 for class annotations (1) (#117775) 2024-05-20 10:42:57 +02:00
Mischa Siekmann
481264693e
Bump aioesphomeapi to 24.4.0 (#117543) 2024-05-16 10:53:00 +02:00
epenet
2e155f4de5
Move esphome coordinator to separate module (#117427) 2024-05-14 15:16:47 +02:00
Markus
ed4c3196ab
Add ESPhome discovery via MQTT (#116499)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-10 13:32:42 +02:00
Sid
2cc916db6d
Replace pylint broad-except with Ruff BLE001 (#116250) 2024-05-07 14:00:27 +02:00
Sid
b456d97e65
Replace pylint protected-access with Ruff SLF001 (#115735) 2024-05-06 20:33:26 +02:00
J. Nick Koston
d0f5e40b19
Refactor ESPHome manager to avoid sending signals in tests (#116033) 2024-04-24 16:14:44 +02:00
David Friedland
e3016b131a
Add Event support to ESPHome components (#116061)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-04-24 13:22:03 +12:00
Jesse Hills
85203aeb28
Bump aioesphomeapi to 24.3.0 (#116004) 2024-04-23 11:23:28 +02:00
Jesse Hills
9b6863f182
ESPHome: Add datetime entities (#115942) 2024-04-22 13:12:22 +02:00
Jesse Hills
46941adb51
Bump aioesphomeapi to 24.2.0 (#115943) 2024-04-22 10:30:14 +02:00
Keith Burzinski
14515b77bb
Add valve entity support for ESPHome (#115341)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-04-17 20:47:15 -05:00
Jesse Hills
94a66fa648
Bump aioesphomeapi to 24.1.0 (#115729) 2024-04-17 15:39:38 +12:00
Jesse Hills
68384bba67
Send/receive Voice Assistant audio via ESPHome native API (#114800)
* Protobuf audio test

* Remove extraneous code

* Rework voice assistant pipeline

* Move variables

* Fix reading flags

* Dont directly put to queue

* Bump aioesphomeapi to 24.0.0

* Update tests

- Add more tests for API pipeline
- Convert some udp tests to use api pipeline
- Update fixtures for new device info flags

* Fix bad merge

---------

Co-authored-by: Michael Hansen <mike@rhasspy.org>
2024-04-09 10:55:59 -04:00
J. Nick Koston
ca5ed274cb
Deprecate calling async_listen and async_listen_once with run_immediately (#115169) 2024-04-08 10:07:54 -10:00
Marc Mueller
3c5089bc3f
Update import for EventStateChangedData [a-h] (#114899) 2024-04-04 11:48:36 -10:00
Sid
a5b609f081
Enable ruff TRY401 (#114395)
* Enable ruff TRY401

* fix tests
2024-03-29 07:20:36 +01:00
J. Nick Koston
bec45dacf0
Add additional coverage to the ESPHome manager (#114265) 2024-03-27 20:52:45 -10:00
Marc Mueller
09ebca9630
Use SignalType to improve typing [esphome] (#114296) 2024-03-27 08:22:10 -04:00
J. Nick Koston
a0d43aeba2
Remove unused code in ESPHome entry_data (#114263) 2024-03-26 10:32:16 -10: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
efc54971d3
Update empty line formatting after module docstring (#114040) 2024-03-23 00:27:57 +01:00
Jesse Hills
6ddef7bbff
ESPHome: Add Time Entity support (#113852) 2024-03-21 16:59:43 +13:00
Jesse Hills
510e7ccf76
Bump aioesphomeapi to 23.2.0 (#113854) 2024-03-19 19:40:09 -10:00
J. Nick Koston
dbbd6fff01
Move ESPHome disconnects to the close event (#113652) 2024-03-17 08:15:28 -10:00
Sid
6ee273a548
Clean up unneeded ruff noqa directives (#113616) 2024-03-16 09:48:37 -10:00
soonsouth
cfc2f17f35
Remove repetitive words in comments and docstrings (#113529)
chore: remove repetitive words

Signed-off-by: soonsouth <cuibuwei@163.com>
2024-03-15 18:11:12 +01:00
Jesse Hills
3d7d3d263d
ESPHome: Add Date Entity support (#112475)
* ESPHome: Add Date Entity support

* Formatting

* Add missing state test
2024-03-13 08:02:52 +01:00
Jesse Hills
a2a8a8f119
ESPHome: Catch and re-raise client library errors as HomeAssistantErrors (#113026) 2024-03-12 18:06:25 -10:00
J. Nick Koston
4c82196fc8
Avoid some event loop overhead for ESPHome listeners (#113173) 2024-03-12 21:49:31 +01:00
Joost Lekkerkerker
643e6096da
Improve lists in integrations [E-F] (#113075) 2024-03-12 18:42:43 +01:00
J. Nick Koston
e96ef4613c
Bump aioesphomeapi to 23.1.1 (#113016)
changelog: https://github.com/esphome/aioesphomeapi/compare/v23.1.0...v23.1.1

Fixes cryptic error message the user tried to send a command
or execute a service call when the device was disconnected
2024-03-10 23:18:49 -04:00
J. Nick Koston
f1b5dcdd1b
Refactor handling of device updates in ESPHome (#112864) 2024-03-09 20:30:17 -10:00
Marc Mueller
25237e0377
Replace EventType with Event [a-g] (#112739) 2024-03-08 19:35:17 +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
0e3945ca6c
Add empty line after module docstring [d-f] (#112698) 2024-03-08 14:15:26 +01:00
Jesse Hills
3ccbb2c87a
Bump aioesphomeapi to 23.1.0 (#112560) 2024-03-07 16:44:58 +13:00
J. Nick Koston
4249d17c1b
Reduce ESPHome reconnect time (#112001)
Use eager tasks to request device_info and entities which avoids
waiting one event loop to send the requests to the device
2024-03-01 22:16:01 -05:00
Erik Montnemery
e06446d0fa
Migrate integrations e-h to generic flowhandler (#111862) 2024-02-29 20:07:36 +01:00
Michael Hansen
890e651bdd
Avoid race condition with UDP voice server starting in ESPHome (#111644)
* Avoid race condition with UDP server starting

* Fix test
2024-02-27 10:54:56 -06:00
Jesse Hills
e1dade69e1
ESPHome: Pass through wake_word_phrase from on-device microWakeWord (#111585)
* ESPHome: Pass through wake_word_phrase from on-device microWakeWord

* Bump aioesphomeapi to 23.0.0
2024-02-26 23:29:03 -05:00
J. Nick Koston
4ea1c5cc3c
Add support for importing integrations in the executor (#111336)
* Add support for pre-imports at setup time

alternative solution to #111331

* refactor

* refactor

* refactor

* mark >1.0s integrations

* no point in executor if already loaded

* no point in executor if already loaded

* cleanup

* cleanup

* two more

* one more

* analytics loads a lot more integrations

* cloud

* debug

* psutil, hardwre

* try zha

* Update homeassistant/setup.py

* await

* comments

* coverage

* coverage

* coverage

* move logic to loader

* move logic to loader

* preserve comments
2024-02-26 14:49:43 -05:00
dougiteixeira
34e9c29ef2
Esphome text sensor device class (#111057) 2024-02-25 16:56:52 -10:00
dougiteixeira
c8ec66fcbe
Bump aioesphomeapi to 22.1.0 (#111435) 2024-02-25 14:58:37 -10:00
J. Nick Koston
fb7da1ba83
Simplify ESPHome entity removal process (#111076) 2024-02-22 11:39:53 -10:00