Use primaryMACAddress naming for consistency
This commit is contained in:
parent
655b21c0e9
commit
89ad6fe39b
@ -26,7 +26,7 @@ export class Hub extends EventEmitter {
|
|||||||
protected _name: string = "";
|
protected _name: string = "";
|
||||||
protected _firmwareVersion: string = "0.0.00.0000";
|
protected _firmwareVersion: string = "0.0.00.0000";
|
||||||
protected _hardwareVersion: string = "0.0.00.0000";
|
protected _hardwareVersion: string = "0.0.00.0000";
|
||||||
protected _macAddress: string = "00:00:00:00:00:00";
|
protected _primaryMACAddress: string = "00:00:00:00:00:00";
|
||||||
protected _batteryLevel: number = 100;
|
protected _batteryLevel: number = 100;
|
||||||
protected _voltage: number = 0;
|
protected _voltage: number = 0;
|
||||||
protected _current: number = 0;
|
protected _current: number = 0;
|
||||||
@ -75,10 +75,10 @@ export class Hub extends EventEmitter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @readonly
|
* @readonly
|
||||||
* @property {string} macAddress Primary mac address of the hub
|
* @property {string} primaryMACAddress Primary MAC address of the hub
|
||||||
*/
|
*/
|
||||||
public get macAddress () {
|
public get primaryMACAddress () {
|
||||||
return this._macAddress;
|
return this._primaryMACAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ export class LPF2Hub extends Hub {
|
|||||||
return [t[0], t[1], t.substring(2, 4), t.substring(4)].join(".");
|
return [t[0], t[1], t.substring(2, 4), t.substring(4)].join(".");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static decodeMacAddress(v: Uint8Array) {
|
private static decodeMACAddress(v: Uint8Array) {
|
||||||
return Array.from(v).map((n) => toHex(n, 2)).join(":");
|
return Array.from(v).map((n) => toHex(n, 2)).join(":");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,7 +274,7 @@ export class LPF2Hub extends Hub {
|
|||||||
|
|
||||||
// primary MAC Address
|
// primary MAC Address
|
||||||
} else if (data[3] === 0x0d) {
|
} else if (data[3] === 0x0d) {
|
||||||
this._macAddress = LPF2Hub.decodeMacAddress(data.slice(4, 10));
|
this._primaryMACAddress = LPF2Hub.decodeMACAddress(data.slice(4, 10));
|
||||||
|
|
||||||
// Battery level reports
|
// Battery level reports
|
||||||
} else if (data[3] === 0x06) {
|
} else if (data[3] === 0x06) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user