Add post update hook to module and use in smart LightEffect (#921)

Adds a post update hook to modules so they can calculate values and collections once rather than on each property access
This commit is contained in:
Steven B
2024-05-19 10:18:17 +01:00
committed by GitHub
parent 3490a1ef84
commit 9989d0f6ec
5 changed files with 46 additions and 23 deletions

View File

@@ -48,7 +48,10 @@ async def test_initial_update(dev: SmartDevice, mocker: MockerFixture):
"""Test the initial update cycle."""
# As the fixture data is already initialized, we reset the state for testing
dev._components_raw = None
dev._components = {}
dev._modules = {}
dev._features = {}
dev._children = {}
negotiate = mocker.spy(dev, "_negotiate")
initialize_modules = mocker.spy(dev, "_initialize_modules")