feat(ws): handle activated message from server, switch to APPS+time

Made-with: Cursor
This commit is contained in:
stswangzhiping
2026-03-19 09:24:10 +08:00
parent fba9d401c2
commit 16f82d6ab8

View File

@@ -210,6 +210,9 @@ class ClawClient {
break; break;
case 'heartbeat_ack': case 'heartbeat_ack':
break; break;
case 'activated':
this._onActivated();
break;
case 'error': case 'error':
log.error('clawd', `服务器错误: ${msg.msg}`); log.error('clawd', `服务器错误: ${msg.msg}`);
if (msg.msg === 'hardware_mismatch') { if (msg.msg === 'hardware_mismatch') {
@@ -268,6 +271,12 @@ class ClawClient {
this._startHeartbeat(); this._startHeartbeat();
} }
_onActivated() {
log.info('clawd', '收到激活通知,切换至已激活状态');
led.status.setApps();
led.display.showTime();
}
// ── 心跳 ──────────────────────────────────────────────────────────────────── // ── 心跳 ────────────────────────────────────────────────────────────────────
_startHeartbeat() { _startHeartbeat() {