Skip to content

Commit a225520

Browse files
move on and off status prints to front of cmd
1 parent 57b46e7 commit a225520

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

functions/peripherals.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def toggle_peripheral(self, peripheral_id):
8989

9090
def on(self, peripheral_id):
9191
"""Turns specified peripheral `on` (100%)."""
92+
self.state.print_status(description=f"Turning ON peripheral {peripheral_id}.")
9293

9394
peripheral = self.info.api_get("peripherals", peripheral_id)
9495
mode = peripheral["mode"]
@@ -98,13 +99,12 @@ def on(self, peripheral_id):
9899
elif mode == 0:
99100
self.control_peripheral(peripheral_id, 1)
100101

101-
self.state.print_status(description=f"Turned ON peripheral {peripheral_id}.")
102102
return
103103

104104
def off(self, peripheral_id):
105105
"""Turns specified peripheral `off` (0%)."""
106+
self.state.print_status(description=f"Turning OFF peripheral {peripheral_id}.")
106107

107108
self.control_peripheral(peripheral_id, 0)
108109

109-
self.state.print_status(description=f"Turned OFF peripheral {peripheral_id}.")
110110
return

0 commit comments

Comments
 (0)