feat(led): showErr(code) + WS fail>=3 shows ERRa or AP on VFD
Made-with: Cursor
This commit is contained in:
12
lib/led.js
12
lib/led.js
@@ -108,6 +108,18 @@ class Display {
|
||||
log.info('display', '显示屏 → AP');
|
||||
}
|
||||
|
||||
/**
|
||||
* 网络错误 → 显示错误码(ERR + 单字母代码)
|
||||
* code='a' → ERRa(网络正常但 VPS 不可达)
|
||||
* code='b' → ERRb(预留)
|
||||
*/
|
||||
showErr(code = 'a') {
|
||||
this._stopBlink();
|
||||
const s = ('ERR' + code).slice(0, 4);
|
||||
this._write('#m3' + s);
|
||||
log.info('display', `显示屏 → ${s}`);
|
||||
}
|
||||
|
||||
/** 网络已连接 → 显示时间 */
|
||||
showTime() {
|
||||
this._stopBlink();
|
||||
|
||||
Reference in New Issue
Block a user