fix(led,provision): AP forces WiFi(play) off; LAN uses carrier+operstate
- Monitor: every tick in ap state led.off() so play never stays on with hotspot - hasLanCableCarrier: _ifacePhysicalLinkUp (carrier=1 and operstate not down) - When end0/eth0 exist but link down, return false (no fallback to hasWiredCarrier) - LAN poll 500ms Made-with: Cursor
This commit is contained in:
@@ -199,15 +199,16 @@ class ProvisionManager extends EventEmitter {
|
||||
this.emit('network-ready');
|
||||
}
|
||||
|
||||
// WiFi 灯:只在 STA 模式下反映互联网连通性;AP 模式下始终熄灭
|
||||
if (this._state === 'sta') {
|
||||
// 产品 WiFi 灯(OpenVFD play):AP 全程强制熄灭,避免与其它逻辑竞态导致误亮
|
||||
if (this._state === 'ap') {
|
||||
led.off();
|
||||
} else if (this._state === 'sta') {
|
||||
if (hasInternet()) {
|
||||
led.on();
|
||||
} else {
|
||||
led.off(); // WiFi 已连接但无互联网
|
||||
led.off(); // STA 已连热点但无互联网
|
||||
}
|
||||
}
|
||||
// AP 模式下 led 已在 _enterAP() 中熄灭,无需重复操作
|
||||
}, MONITOR_INTERVAL_MS);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user