Commit Graph

204 Commits (8020bec47bff5c6e5f08eb1e4dafaeaa85238bd9)

Author SHA1 Message Date
Erik Montnemery 235fda55fe
Validate config entry when adding or updating entity registry entry (#135067) 2025-01-17 19:18:13 +01:00
Marcel van der Veldt 8f38b7191a
Fix for Hue sending effect None at turn_on command while no effect is active (#125377)
* Fix for Hue sending effect None at turn_on command while no effect is active

* typo

* update tests
2024-09-06 14:06:46 +02:00
Ino Dekker 611723e44b
Bump aiohue to version 4.7.3 (#124436) 2024-08-23 13:43:17 +02:00
Marcel van der Veldt 6d4711ce43
Bump aiohue to version 4.7.2 (#122651) 2024-07-29 11:59:13 +02:00
Barry vd. Heuvel d113ea8e47
Convert Hue scenes brightness to 0..255 (#105871)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-07-06 19:04:52 +02:00
epenet b9cfd4e8ce
Improve type hints in hue tests (#121298) 2024-07-05 14:40:23 +02:00
epenet 9ca9377cad
Use common registry fixtures in hue (#121003) 2024-07-02 12:26:25 +02:00
epenet c9911fa8ce
Use service_calls fixture in hue tests (#120928) 2024-07-01 16:16:19 +02:00
Marcel van der Veldt bad5eaf329
Add entity ids to grouped hue light (#113053) 2024-06-21 15:04:42 +02:00
J. Nick Koston dbd3147c9b
Remove `async_late_forward_entry_setups` and instead implicitly hold the lock (#119088)
* Refactor config entry forwards to implictly obtain the lock instead of explictly

This is a bit of a tradeoff to not need async_late_forward_entry_setups

The downside is we can no longer detect non-awaited plastform setups
as we will always implicitly obtain the lock instead of explictly.

Note, this PR is incomplete and is only for discussion purposes
at this point

* preen

* cover

* cover

* restore check for non-awaited platform setup

* cleanup

* fix missing word

* make non-awaited test safer
2024-06-12 21:06:11 -04:00
epenet fb1b0058ee
Fix consider-using-tuple pylint warnings in component tests (#119464)
* Fix consider-using-tuple pylint warnings in component tests

* Apply su

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>

---------

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
2024-06-12 15:50:27 +02:00
epenet c896458fcf
Fix namespace-import pylint warning in components (#119299) 2024-06-10 15:55:08 +02:00
epenet b8e57f6174
Use relative imports in tests [a-i] (#119280) 2024-06-10 12:52:34 +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
epenet 7e62061b9a
Improve typing for `calls` fixture in tests (a-l) (#118349)
* Improve typing for `calls` fixture in tests (a-l)

* More

* More
2024-05-29 09:06:48 +02:00
Marcel van der Veldt 5af8041c57
Fix ghost events for Hue remotes (#113047)
* Use report values for events

* adjust tests
2024-05-15 15:48:15 +02:00
Erik Montnemery 0acf392a50
Use `MockConfigEntry` in hue tests (#117237)
Use MockConfigEntry in hue tests
2024-05-11 23:36:54 -04:00
Erik Montnemery db8597a742
Reduce scope of JSON/XML test fixtures (#116197) 2024-04-25 19:12:36 -05:00
Sid 895f73d8e4
Enable Ruff A001 (#115654) 2024-04-21 23:25:27 +02:00
Joost Lekkerkerker b9281327c4
Use FlowResultType enum in config flow tests A-M (#114681) 2024-04-03 09:21:17 +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
Sid d5fd005db8
Add ruff rule PIE808 (#113621) 2024-03-17 09:56:26 +01:00
Sid fe9cc6705c
Add ruff rule PIE804 (#113620)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-16 12:45:18 -10:00
Marcel van der Veldt 0eb1adccf8
Fix for Hue not applying effect in scene (#113057) 2024-03-11 15:08:00 +01:00
Marcel van der Veldt a7a30581fc
Fix adding Hue bridge manually by IP (#113055) 2024-03-11 12:35:41 +01:00
J. Nick Koston a2318c26c9
Run debouncer tasks eagerly to avoid scheduling on the event loop (#112789) 2024-03-10 08:37:10 -10:00
Marc Mueller 32f3f46542
Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Marc Mueller c88b337600
Add empty line after module docstring [tests f-k] (#112709) 2024-03-08 14:50:04 +01:00
J. Nick Koston bef8376f83
Use MockConfigEntry in hue tests (#112149)
needed for https://github.com/home-assistant/core/pull/112141
2024-03-03 21:21:33 -05:00
J. Nick Koston 704ad67917
Ensure hue tests add config entry before updating it (#110428) 2024-02-13 04:59:26 +01:00
J. Nick Koston cc13d7eec7
Migrate hue to use async_update_entry to alter config entries (#110310) 2024-02-12 20:20:10 +01:00
J. Nick Koston 02efe41564
Avoid directly changing config entry state in tests (#110048) 2024-02-08 16:31:17 -06:00
Erik Montnemery b420c65016
Fix hue fallback onoff colormode (#109856)
Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
2024-02-07 08:14:55 +01:00
Marc Mueller 7a89e58873
Use builtin TimeoutError [e-i] (#109679) 2024-02-05 12:00:37 +01:00
Erik Montnemery 6908497c3d
Add minor version to config entries (#105479) 2023-12-12 08:44:35 +01:00
Jan-Philipp Benecke eda475fe25
Update h* tests to use entity & device registry fixtures (#103866)
* Update h* tests to use entity & device registry fixtures

* Add missed lines
2023-11-12 13:52:32 -05:00
starkillerOG 93a8b60c2b
Philips Hue restore brightness after transition (#101293) 2023-10-25 07:46:49 +02:00
Paul Bottein c98c18f25e
Return 'None' for light attributes when off instead of removing them (#101946) 2023-10-19 01:08:08 +02:00
Marcel van der Veldt 6393171fa4
Adjust Hue integration to use Entity descriptions and translatable entity names (#101413)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2023-10-09 14:14:07 +02:00
Marcel van der Veldt 35616e100d
Discover switch entities from Hue behavior_script instances (#101262) 2023-10-02 17:15:41 +02:00
Marcel van der Veldt b569cb61e9
Adopt Hue integration to latest changes in Hue firmware (#101001) 2023-09-27 23:36:12 +02:00
J. Nick Koston 0eca433004
Update zeroconf discovery to use IPAddress objects to avoid conversions (#100567) 2023-09-19 18:58:46 +02:00
Erik Montnemery dd39e8fe64
Use freezegun in hue tests (#99033) 2023-08-25 09:04:28 -05:00
Erik Montnemery 49011f0158
Adjust hue tests which create devices (#98195) 2023-08-10 18:27:05 +02:00
Franck Nijhof 868a5f377f
Ruff: isort don't split imports based on trailing comma (#98162) 2023-08-10 14:27:03 +02:00
Marcel van der Veldt 7ada88eab3
Hue event entity follow up (#97336) 2023-07-27 16:58:09 +02:00
Marcel van der Veldt 2ae059d4fc
Add Event platform/entity to Hue integration (#97256)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-07-26 16:42:01 +02:00
Erik Montnemery 7539cf25be
Don't require passing identifiers to DeviceRegistry.async_get_device (#96479)
* Require keyword arguments to DeviceRegistry.async_get_device

* Update tests

* Update tests

* Don't enforce keyword arguments
2023-07-13 13:39:25 -04:00
Erik Montnemery 5884afd485
Teach sensor device trigger about entity registry ids (#94988) 2023-06-22 11:13:54 +02:00