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:
Teemu R.
2024-07-24 15:47:38 +02:00
committed by GitHub
parent ed033679e5
commit dc0aedad20
5 changed files with 27 additions and 1 deletions

View File

@@ -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():