Allow erroring modules to recover (#1080)

Re-query failed modules after some delay instead of immediately disabling them.
Changes to features so they can still be created when modules are erroring.
This commit is contained in:
Steven B.
2024-07-30 19:23:07 +01:00
committed by GitHub
parent 445f74eed7
commit 7bba9926ed
23 changed files with 264 additions and 187 deletions

View File

@@ -27,7 +27,7 @@ def dummy_feature() -> Feature:
container=None,
icon="mdi:dummy",
type=Feature.Type.Switch,
unit="dummyunit",
unit_getter=lambda: "dummyunit",
)
return feat
@@ -127,7 +127,7 @@ async def test_feature_action(mocker):
async def test_feature_choice_list(dummy_feature, caplog, mocker: MockerFixture):
"""Test the choice feature type."""
dummy_feature.type = Feature.Type.Choice
dummy_feature.choices = ["first", "second"]
dummy_feature.choices_getter = lambda: ["first", "second"]
mock_setter = mocker.patch.object(dummy_feature.device, "dummysetter", create=True)
await dummy_feature.set_value("first")