更新优化100j体验问题
This commit is contained in:
@ -209,12 +209,16 @@ class HBY100JProtocol {
|
||||
if (this._fileResponseResolve) this._fileResponseResolve(result);
|
||||
break;
|
||||
case 0x04:
|
||||
// 5.5 获取设备电源状态: 电池容量8B + 电压8B + 百分比1B + 车载电源1B + 续航时间2B(分钟)
|
||||
// 5.5 获取设备电源状态: 容量8B + 电压8B + 百分比1B + 车载1B + 续航2B(分钟) + [充电状态1B] + FF
|
||||
// 充电状态为固件新增,在续航之后;旧固件仅 20 字节 payload,不影响 [16..19] 字段
|
||||
if (data.length >= 20) {
|
||||
result.batteryPercentage = data[16];
|
||||
result.vehiclePower = data[17];
|
||||
result.batteryRemainingTime = data[18] | (data[19] << 8); // 小端序,单位分钟
|
||||
}
|
||||
if (data.length >= 21) {
|
||||
result.chargingStatus = data[20]; // 0未充电 1充电中 2已充满
|
||||
}
|
||||
break;
|
||||
case 0x06:
|
||||
// 06: 语音播报响应
|
||||
|
||||
@ -1383,6 +1383,9 @@
|
||||
if (parsedData.batteryRemainingTime !== undefined) {
|
||||
this.$set(this.deviceInfo, 'batteryRemainingTime', parsedData.batteryRemainingTime);
|
||||
}
|
||||
if (parsedData.chargingStatus !== undefined) {
|
||||
this.$set(this.deviceInfo, 'chargingStatus', parsedData.chargingStatus);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user