update start light

This commit is contained in:
IrvingGao 2024-05-27 23:38:52 +08:00
parent 423269f538
commit 88843ff4ad
1 changed files with 11 additions and 2 deletions

View File

@ -27,6 +27,15 @@ from takway.clients.client_utils import BaseWebSocketClient
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:
def __init__(self,
board,
@ -141,8 +150,8 @@ class WebSocketClinet:
last_short_power_status = False
board = self.board
if board == 'orangepi':
recorder.hardware.set_led_on("green")
start_status_light(recorder.hardware, board)
while True:
# 开关按键被按下
if recorder.hardware.long_power_status: