381 Commits

Author SHA1 Message Date
Robert Svensson
8c459959ee
Use fixtures in deCONZ gateway tests (#121305) 2024-07-05 16:59:10 +02:00
Robert Svensson
eb5a98e7ea
Use fixtures in deCONZ light tests PT2 (#121208) 2024-07-05 10:57:17 +02:00
Robert Svensson
dcef25c0fa
Use fixtures in deCONZ climate tests (#121242) 2024-07-05 09:01:45 +02:00
Robert Svensson
62d9020261
Remove legacy method from deCONZ fan and sensor tests (#121244) 2024-07-04 18:17:15 -05:00
Robert Svensson
d12f2384c5
Use fixtures in deCONZ config flow tests PT2 (#121203)
* Use fixtures in deCONZ config flow tests PT2

* Update tests/components/deconz/test_config_flow.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-07-04 15:53:25 +02:00
Robert Svensson
24c82c2475
Use fixtures in deCONZ sensor tests PT2 (#121204) 2024-07-04 15:48:49 +02:00
Robert Svensson
f78933235d
Use fixtures in deCONZ service tests (#121108)
* Use fixtures in deCONZ service tests

* Update tests/components/deconz/test_services.py

Co-authored-by: J. Nick Koston <nick@koston.org>

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-07-04 14:23:40 +02:00
Robert Svensson
ece8b74967
Use fixtures in deCONZ device trigger tests (#121103) 2024-07-04 14:23:15 +02:00
Robert Svensson
1d8382a498
Use fixtures in deCONZ light tests PT1 (#121112)
Use fixtures in deCONZ light tests part 1
2024-07-04 14:22:10 +02:00
Robert Svensson
873d96bab3
Use fixtures in deCONZ binary sensor tests (#120966) 2024-07-04 14:21:26 +02:00
Robert Svensson
31ed32da6c
Use fixtures in deCONZ alarm control panel tests (#120967) 2024-07-04 14:20:57 +02:00
Robert Svensson
d429bcef16
Use fixtures in deCONZ sensor tests PT1 (#121116) 2024-07-04 11:50:23 +02:00
Robert Svensson
02e7707f91
Use fixtures in deCONZ config flow tests PT1 (#121121) 2024-07-04 04:49:46 -05:00
Robert Svensson
baf2ebf1f2
Use fixtures in deCONZ diagnostics tests (#120968) 2024-07-02 12:43:34 +02:00
Robert Svensson
0ffebd4853
Use fixtures in deCONZ button tests (#120958) 2024-07-01 20:48:33 +02:00
Robert Svensson
690164a518
Use fixtures in deCONZ cover tests (#120954) 2024-07-01 20:31:42 +02:00
Robert Svensson
167a8c6613
Use fixtures in deCONZ fan tests (#120953) 2024-07-01 19:49:12 +02:00
Robert Svensson
1209abc944
Use fixtures in deCONZ switch tests (#120944) 2024-07-01 19:03:32 +02:00
Robert Svensson
7a3039aecb
Use fixtures in deCONZ lock tests (#120948) 2024-07-01 19:01:32 +02:00
Robert Svensson
d506c30b38
Use fixtures in deCONZ logbook tests (#120947) 2024-07-01 18:58:43 +02:00
Robert Svensson
dcf4e91234
Use fixtures in deCONZ number tests (#120938) 2024-07-01 17:46:46 +02:00
Robert Svensson
361e81821c
Use fixtures in deCONZ scene tests (#120936) 2024-07-01 17:42:32 +02:00
Robert Svensson
77fc1c991c
Use fixtures in deCONZ select tests (#120943) 2024-07-01 17:29:57 +02:00
Robert Svensson
44640ef9e8
First step towards fixtures in deCONZ tests (#120863)
* config entry fixture

* Mock web request

* Make siren tests use new fixtures

* Replace old constants

* Add mock put request

* Change comment
2024-07-01 12:33:51 +02:00
epenet
88583149ea
Use service_calls fixture in deconz tests (#120905) 2024-07-01 10:33:31 +02:00
epenet
09e8f7e9bb
Improve type hints in deconz tests (#120388) 2024-06-25 17:44:03 +02:00
epenet
40d9d22e76
Fix dangerous-default-value warnings in deconz tests (#119599) 2024-06-13 11:55:37 +02:00
epenet
c896458fcf
Fix namespace-import pylint warning in components (#119299) 2024-06-10 15:55:08 +02:00
Sid
721b2c2ca8
Enable Ruff PT012 (#113957) 2024-06-08 17:59:08 +02:00
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
Robert Svensson
5abf77662a
Support carbon dioxide and formaldehyde sensors in deCONZ (#117877)
* Add formaldehyde sensor
* Add carbon dioxide sensor
* Bump pydeconz to v116
2024-05-22 07:33:55 +02:00
Robert Svensson
bbfc2456ec
Improve syncing light states to deCONZ groups (#117588) 2024-05-17 08:44:09 +02:00
Robert Svensson
657b3ceedc
Rework deCONZ services to load once and never unload (#117592)
* Rework deCONZ services to load once and never unload

* Fix hassfest
2024-05-16 21:41:23 -04:00
J. Nick Koston
481de8cdc9
Ensure config entry operations are always holding the lock (#117214)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-12 08:20:08 +09:00
Joost Lekkerkerker
9b41e3d124
Use is in enum comparison in config flow tests A-E (#114669) 2024-04-02 11:22:05 -10:00
Jan Bouwhuis
acf2f855fe
Raise ServiceValidationError on number out of range exception (#114589) 2024-04-02 12:22:00 +02:00
Sid
304ed8bf3d
Unignore Ruff PLC in tests (#114572) 2024-04-01 21:28:54 +02: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
J. Nick Koston
4f18f0d902
Fix setup timings when config entry platform loads are not awaited (#113959)
* Move setup time logging into the context manager

We were fetching the time twice but since the context
manager already has the timing, move it there

* remove log setup assertions from integration test

* tweak logging to give us better data for tracking issues

* redundant

* adjust

* preen

* fixes

* adjust

* make api change internal so nobody uses it

* coverage

* fix test

* fix more tests

* coverage

* more tests assuming internal calls

* fix more

* adjust

* adjust

* fix axis tests

* fix broadlink -- it does not call async_forward_entry_setup

* missed some

* remove useless patch

* rename, detect it both ways

* clear

* debug

* try to fix

* handle phase finishing out while paused

* where its set does not need to know its late as that is an implemenation detail of setup

* where its set does not need to know its late as that is an implemenation detail of setup

* tweak

* simplify

* reduce complexity

* revert order change as it makes review harder

* revert naming changes as it makes review harder

* improve comment

* improve debug

* late dispatch test

* test the other way as well

* Update setup.py

* Update setup.py

* Update setup.py

* simplify

* reduce
2024-03-23 15:26:38 -04:00
Robert Svensson
d3c68303b0
Improve deCONZ test_non_color_light_reports_color (#114021) 2024-03-22 22:18:22 +01:00
Robert Svensson
506240be10
Streamline naming in deCONZ integration (#111977) 2024-03-18 22:08:06 +01:00
Robert Svensson
3ba29c361a
Remove old update of group unique id in deCONZ (#112533) 2024-03-15 21:09:44 +02:00
Robert Svensson
9c2c7f1a45
Remove old update of number unique id in deCONZ (#113524) 2024-03-15 21:08:18 +02:00
Robert Svensson
e90388afd1
Remove old update of sensor unique id in deCONZ (#113527) 2024-03-15 21:06:09 +02:00
Robert Svensson
e41133e9f0
Remove old update unique id function from deCONZ binary sensor (#112536) 2024-03-15 12:05:45 +01:00
Robert Svensson
932e073fee
Split out deCONZ config model (#112851)
* Add separate deCONZ config class

* Use config in get_deconz_api
2024-03-13 22:49:49 +01:00
Robert Svensson
ffcbab1c20
Split out deCONZ hub (#112854)
* Rename DeconzGateway to DeconzHub

* Move gateway.py to hub/hub.py
2024-03-10 08:25:12 +01:00
Robert Svensson
03e4a20cdf
Rename get_deconz_session to get_deconz_api (#112826)
Move and rename get_deconz_session to get_deconz_api
2024-03-09 18:32:31 +01:00
Marc Mueller
32f3f46542
Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Marc Mueller
38adfbf1a3
Add empty line after module docstring [tests a-e] (#112708) 2024-03-08 08:50:25 -05:00