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

@@ -40,7 +40,7 @@ class Energy(Module, ABC):
name="Current consumption",
attribute_getter="current_consumption",
container=self,
unit="W",
unit_getter=lambda: "W",
id="current_consumption",
precision_hint=1,
category=Feature.Category.Primary,
@@ -53,7 +53,7 @@ class Energy(Module, ABC):
name="Today's consumption",
attribute_getter="consumption_today",
container=self,
unit="kWh",
unit_getter=lambda: "kWh",
id="consumption_today",
precision_hint=3,
category=Feature.Category.Info,
@@ -67,7 +67,7 @@ class Energy(Module, ABC):
name="This month's consumption",
attribute_getter="consumption_this_month",
container=self,
unit="kWh",
unit_getter=lambda: "kWh",
precision_hint=3,
category=Feature.Category.Info,
type=Feature.Type.Sensor,
@@ -80,7 +80,7 @@ class Energy(Module, ABC):
name="Total consumption since reboot",
attribute_getter="consumption_total",
container=self,
unit="kWh",
unit_getter=lambda: "kWh",
id="consumption_total",
precision_hint=3,
category=Feature.Category.Info,
@@ -94,7 +94,7 @@ class Energy(Module, ABC):
name="Voltage",
attribute_getter="voltage",
container=self,
unit="V",
unit_getter=lambda: "V",
id="voltage",
precision_hint=1,
category=Feature.Category.Primary,
@@ -107,7 +107,7 @@ class Energy(Module, ABC):
name="Current",
attribute_getter="current",
container=self,
unit="A",
unit_getter=lambda: "A",
id="current",
precision_hint=2,
category=Feature.Category.Primary,