diff --git a/takway/board/orangepi.py b/takway/board/orangepi.py index 29f5867..f59e79c 100644 --- a/takway/board/orangepi.py +++ b/takway/board/orangepi.py @@ -78,7 +78,8 @@ class OrangePi(BaseHardware): if press_time_1: press_duration = (datetime.now() - press_time_1).total_seconds() # if press_duration > 0.01: - if press_duration > 5: + if press_duration > 3: + self.set_led_on('red') subprocess.Popen('sudo shutdown now', shell=True) else: self.long_power_status = not self.long_power_status diff --git a/takway/clients/web_socket_client_utils.py b/takway/clients/web_socket_client_utils.py index 4b202a7..b8bdae4 100644 --- a/takway/clients/web_socket_client_utils.py +++ b/takway/clients/web_socket_client_utils.py @@ -270,7 +270,7 @@ class WebSocketClinet: elif self.speaking_event.is_set(): print(f"{datetime.now()}: wait for speaking finished and listening started or sleep mode.") if board == 'orangepi': - recorder.hardware.set_led_on("red") + recorder.hardware.set_led_on("blue") while self.wakeup_event.is_set(): # 睡眠 or 监听状态 if self.sleep_event.is_set() or self.listening_event.is_set(): @@ -279,7 +279,7 @@ class WebSocketClinet: # print(f"{datetime.now()}: button interrupt (input).") # break if board == 'orangepi': - recorder.hardware.set_led_off("red") + recorder.hardware.set_led_off("blue") # 重新计时 slience_bgn_t = time.time() print(f"{datetime.now()}: restart listening.")