Commit graph

22 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
Marc Mueller
2c06d4fcb9
Add empty line after module docstring (2) [components] (#112736) 2024-03-08 19:15:59 +01:00
epenet
1ba18f8df6
Improve type hints in vesync lights (#75998)
* Improve type hints in vesync lights

* Adjust import
2022-08-03 09:56:13 +02:00
J. Nick Koston
cd03c49fc2
Wait for config entry platform forwards (#73806) 2022-07-09 17:27:42 +02:00
Jonathan Keslin
f43c4d51e1
Address late review of VeSync (#63945)
* Fast follow improvements to VeSync

* Apply suggestions to other platforms, use async_on_unload

* Rename dev_list to entities
2022-01-13 00:38:39 +01:00
Jonathan Keslin
56c577c832
Expose power & energy usage of VeSync outlets as separate sensors (#61837) 2022-01-10 09:39:31 -08:00
epenet
e7b262f9e5
Add init type hints [v-z] (#63195)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-02 16:27:12 +01:00
Sebastian Lövdahl
53f4a3d8bc
Use Platform constants all over the place 3/3 (#62954) 2021-12-28 21:24:27 +01:00
epenet
05ac2d4c3a
Ensure service calls are typed [v-z] (#62923)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-28 13:12:06 +01:00
Franck Nijhof
eb5a321a9f
Mark removed config schemas as removed (#61014) 2021-12-21 12:46:10 +01:00
Marc Mueller
d6f48683a3
Use platform enum (8) [Misc] (#61013) 2021-12-13 14:09:49 +01:00
Franck Nijhof
04e631ed1f
Remove deprecated YAML configuration from VeSync (#52358) 2021-06-30 16:29:44 -04:00
Franck Nijhof
b2c0bebbf0
Deprecate VeSync YAML configuration (#50652) 2021-05-15 13:56:23 +02:00
J. Nick Koston
a4ea9b3cd3
Update usage of async_entries to use _async_current_entries (#50187) 2021-05-12 12:47:06 +02:00
J. Nick Koston
f9a2c1cfd5
Reduce config entry setup/unload boilerplate V-Z (#49789) 2021-04-27 22:51:11 +02:00
Quentame
198ecb0945
Uniformize platform setup (#47101)
* A platform is not a component

* Fix dynalite

* SUPPORTED_PLATFORMS --> PLATFORMS

* In tests

* In tests 2

* Fix SmartThings

* Fix ZHA test

* Fix Z-Wave

* Revert Z-Wave

* Use PLATFORMS const in ambient_station

* Fix ihc comment
2021-03-02 21:43:59 +01:00
Jonathan Keslin
b6b1e725c7
Add support for VeSync dimmer switches (#44713)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-02-21 19:16:13 -10:00
Angelo Gagliano
eb7742ea7c
Add support for VeSync Fans (#36132)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-09-03 21:05:37 -05:00
Bas Nijholt
b54c8641b4 Sort imports according to PEP8 for vesync (#29684) 2019-12-09 11:56:02 +01:00
Paulus Schoutsen
4de97abc3a Black 2019-07-31 12:25:30 -07:00
Joe Trabulsy
a8ec826ef7 Add Support for VeSync Devices - Outlets and Switches (#24953)
* Change dependency to pyvesync-v2 for vesync switch

* async vesync component

* FInish data_entry_flow

* Update config flow

* strings.json

* Minor fix

* Syntax fix

* Minor Fixs

* UI Fix

* Minor Correct

* Debug lines

* fix device dictionaries

* Light switch fix

* Cleanup

* pylint fixes

* Hassfest and setup scripts

* Flake8 fixes

* Add vesync light platform

* Fix typo

* Update Devices Service

* Fix update devices service

* Add initial test

* Add Config Flow Tests

* Remove Extra Platforms

* Fix requirements

* Update pypi package

* Add login to config_flow

Avoid setting up component if login credentials are invalid

* Fix variable import

* Update config_flow.py

* Update config_flow.py

* Put VS object into hass.data instead of config entry

* Update __init__.py

* Handle Login Error

* Fix invalid login error

* Fix typo

* Remove line

* PEP fixes

* Fix change requests

* Fix typo

* Update __init__.py

* Update switch.py

* Flake8 fix

* Update test requirements

* Fix permission

* Address change requests

* Address change requests

* Fix device discovery indent, add MockConfigEntry

* Fix vesynclightswitch classs

* Remove active time attribute

* Remove time_zone, grammar check
2019-07-23 23:40:55 +02:00
Paulus Schoutsen
f5076188ef
Consolidate all platforms that have no tests (#22096)
* Consolidate

* Fix tests

* Update imports

* Fix import

* Use importlib because integration and package share name

* Fix more tests

* Update .coveragerc and CODEOWNERS
2019-03-16 20:44:05 -07:00