mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Expose reboot action (#1073)
Expose reboot through the feature interface. This can be useful in situations where one wants to reboot the device, e.g., in recent cases where frequent update calls will render the device unresponsive after a specific amount of time.
This commit is contained in:
@@ -84,6 +84,7 @@ added to the API.
|
||||
state
|
||||
rssi
|
||||
on_since
|
||||
reboot
|
||||
current_consumption
|
||||
consumption_today
|
||||
consumption_this_month
|
||||
|
@@ -25,6 +25,7 @@ Signal Level (signal_level): 2
|
||||
RSSI (rssi): -52
|
||||
SSID (ssid): #MASKED_SSID#
|
||||
Overheated (overheated): False
|
||||
Reboot (reboot): <Action>
|
||||
Brightness (brightness): 100
|
||||
Cloud connection (cloud_connection): True
|
||||
HSV (hsv): HSV(hue=0, saturation=100, value=100)
|
||||
|
@@ -359,6 +359,18 @@ class IotDevice(Device):
|
||||
)
|
||||
)
|
||||
|
||||
self._add_feature(
|
||||
Feature(
|
||||
device=self,
|
||||
id="reboot",
|
||||
name="Reboot",
|
||||
attribute_setter="reboot",
|
||||
icon="mdi:restart",
|
||||
category=Feature.Category.Debug,
|
||||
type=Feature.Type.Action,
|
||||
)
|
||||
)
|
||||
|
||||
for module in self._supported_modules.values():
|
||||
module._initialize_features()
|
||||
for module_feat in module._module_features.values():
|
||||
|
@@ -439,6 +439,18 @@ class SmartDevice(Device):
|
||||
)
|
||||
)
|
||||
|
||||
self._add_feature(
|
||||
Feature(
|
||||
device=self,
|
||||
id="reboot",
|
||||
name="Reboot",
|
||||
attribute_setter="reboot",
|
||||
icon="mdi:restart",
|
||||
category=Feature.Category.Debug,
|
||||
type=Feature.Type.Action,
|
||||
)
|
||||
)
|
||||
|
||||
for module in self.modules.values():
|
||||
module._initialize_features()
|
||||
for feat in module._module_features.values():
|
||||
|
Reference in New Issue
Block a user