update start light
This commit is contained in:
parent
423269f538
commit
88843ff4ad
|
@ -27,6 +27,15 @@ from takway.clients.client_utils import BaseWebSocketClient
|
||||||
from takway.audio_utils import AudioPlayer
|
from takway.audio_utils import AudioPlayer
|
||||||
|
|
||||||
|
|
||||||
|
def start_status_light(hardware, board):
|
||||||
|
if board == 'orangepi':
|
||||||
|
for i in range(2):
|
||||||
|
hardware.set_led_on("green")
|
||||||
|
time.sleep(0.5)
|
||||||
|
hardware.set_led_off("green")
|
||||||
|
time.sleep(0.5)
|
||||||
|
|
||||||
|
|
||||||
class WebSocketClinet:
|
class WebSocketClinet:
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
board,
|
board,
|
||||||
|
@ -141,8 +150,8 @@ class WebSocketClinet:
|
||||||
last_short_power_status = False
|
last_short_power_status = False
|
||||||
|
|
||||||
board = self.board
|
board = self.board
|
||||||
if board == 'orangepi':
|
|
||||||
recorder.hardware.set_led_on("green")
|
start_status_light(recorder.hardware, board)
|
||||||
while True:
|
while True:
|
||||||
# 开关按键被按下
|
# 开关按键被按下
|
||||||
if recorder.hardware.long_power_status:
|
if recorder.hardware.long_power_status:
|
||||||
|
|
Loading…
Reference in New Issue