Skip to content

Commit 0d77fa3

Browse files
committed
add missing controller restart function
1 parent 0a6c71e commit 0d77fa3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

mycodo/mycodo_daemon.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,15 @@ def controller_deactivate(self, cont_id):
11781178
self.logger.exception(message)
11791179
return 1, message
11801180

1181+
def controller_restart(self, cont_id):
1182+
"""Restart a controller."""
1183+
try:
1184+
return self.mycodo.controller_restart(cont_id)
1185+
except Exception as except_msg:
1186+
message = f"Could not restart controller with ID {cont_id}: {except_msg}"
1187+
self.logger.exception(message)
1188+
return 1, message
1189+
11811190
def controller_is_active(self, cont_id):
11821191
"""Checks if a controller is active."""
11831192
return self.mycodo.controller_is_active(cont_id)

0 commit comments

Comments
 (0)