@bobfrankston/lxlan 0.1.20 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/device.d.ts +3 -3
  2. package/device.js +10 -3
  3. package/package.json +2 -2
package/device.d.ts CHANGED
@@ -20,8 +20,6 @@ export declare class LxDevice extends DeviceBase {
20
20
  firmwareVersion?: number;
21
21
  /** WiFi signal strength (0.0 to 1.0) */
22
22
  signal?: number;
23
- /** RSSI in dBm (calculated from signal) */
24
- rssi?: number;
25
23
  /** Device uptime in milliseconds */
26
24
  uptime?: number;
27
25
  /** Device downtime in milliseconds */
@@ -43,13 +41,15 @@ export declare class LxDevice extends DeviceBase {
43
41
  * Do not call directly - use `client.addDevice(mac, ip)` instead.
44
42
  * Devices created directly will not have a transport and will throw errors when used.
45
43
  *
46
- * @param mac - MAC address (will be normalized to lowercase, no separators)
44
+ * @param mac - MAC address (will be normalized to lowercase, colon-separated)
47
45
  * @param ip - IP address (optional, can be discovered)
48
46
  * @internal
49
47
  */
50
48
  constructor(mac: string, ip?: string);
51
49
  /** Brightness 0-100 (reads color.b) */
52
50
  get brightness(): number;
51
+ /** Firmware version as string (decodes firmwareVersion number) */
52
+ get fwVersion(): string;
53
53
  /** Request current state (sends LIFX Get) */
54
54
  requestState(): void;
55
55
  /** Get product name from product ID */
package/device.js CHANGED
@@ -21,8 +21,6 @@ export class LxDevice extends DeviceBase {
21
21
  firmwareVersion;
22
22
  /** WiFi signal strength (0.0 to 1.0) */
23
23
  signal;
24
- /** RSSI in dBm (calculated from signal) */
25
- rssi;
26
24
  /** Device uptime in milliseconds */
27
25
  uptime;
28
26
  /** Device downtime in milliseconds */
@@ -44,7 +42,7 @@ export class LxDevice extends DeviceBase {
44
42
  * Do not call directly - use `client.addDevice(mac, ip)` instead.
45
43
  * Devices created directly will not have a transport and will throw errors when used.
46
44
  *
47
- * @param mac - MAC address (will be normalized to lowercase, no separators)
45
+ * @param mac - MAC address (will be normalized to lowercase, colon-separated)
48
46
  * @param ip - IP address (optional, can be discovered)
49
47
  * @internal
50
48
  */
@@ -53,6 +51,15 @@ export class LxDevice extends DeviceBase {
53
51
  }
54
52
  /** Brightness 0-100 (reads color.b) */
55
53
  get brightness() { return this.color.b; }
54
+ /** Firmware version as string (decodes firmwareVersion number) */
55
+ get fwVersion() {
56
+ if (!this.firmwareVersion)
57
+ return '';
58
+ const major = (this.firmwareVersion >> 16) & 0xFF;
59
+ const minor = (this.firmwareVersion >> 8) & 0xFF;
60
+ const patch = this.firmwareVersion & 0xFF;
61
+ return `${major}.${minor}.${patch}`;
62
+ }
56
63
  /** Request current state (sends LIFX Get) */
57
64
  requestState() { this.getState(); }
58
65
  /** Get product name from product ID */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/lxlan",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "description": "LIFX LAN protocol library for device control via UDP",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@bobfrankston/colorlib": "^0.1.8",
35
- "@bobfrankston/devdefs": "^0.1.2",
35
+ "@bobfrankston/devdefs": "^0.1.4",
36
36
  "@bobfrankston/udp-transport": "^1.0.2"
37
37
  },
38
38
  "devDependencies": {