From 88843ff4adc7c0b7ad3bf5b41455227591359117 Mon Sep 17 00:00:00 2001 From: IrvingGao <1729854488@qq.com> Date: Mon, 27 May 2024 23:38:52 +0800 Subject: [PATCH] update start light --- takway/clients/web_socket_client_utils.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/takway/clients/web_socket_client_utils.py b/takway/clients/web_socket_client_utils.py index 6033cad..39a90d1 100644 --- a/takway/clients/web_socket_client_utils.py +++ b/takway/clients/web_socket_client_utils.py @@ -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: