mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user