{"_id":"@bobfrankston/devdefs","_rev":"6-95fe46f4aa886c7657cf5f949c4c4254","name":"@bobfrankston/devdefs","dist-tags":{"latest":"0.1.6"},"versions":{"0.1.1":{"name":"@bobfrankston/devdefs","version":"0.1.1","keywords":["smart-home","device","base-class","lan"],"author":{"name":"Bob Frankston"},"license":"MIT","_id":"@bobfrankston/devdefs@0.1.1","maintainers":[{"name":"bobfrankston","email":"npm@bob.ma"}],"homepage":"https://github.com/BobFrankston/devdefs#readme","bugs":{"url":"https://github.com/BobFrankston/devdefs/issues"},"dist":{"shasum":"b70901dbc2a38132b9efc9ced1140deac2adb3a5","tarball":"https://registry.npmjs.org/@bobfrankston/devdefs/-/devdefs-0.1.1.tgz","fileCount":6,"integrity":"sha512-6CSgqcKBYv6ltPooPlNfwoWYA4abVjHnKVo8Rxfdpb8irdHWWs2IAZmLX0cO9SD86QzqFx6Ovbh2ze1ReNX2vA==","signatures":[{"sig":"MEYCIQCQvB39DXDFmiUj3Vr+/iWjsCJ0UNvQ1GMB15BtLD7iRwIhAM/7MOyzPpWrp2g3vqVzZOG02k1go1TOl6KQauQQ5CmD","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6986},"main":"index.js","type":"module","_from":"file:bobfrankston-devdefs-0.1.1.tgz","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"scripts":{"build":"tsc","watch":"tsc -w","release":"npmglobalize"},"_npmUser":{"name":"bobfrankston","email":"npm@bob.ma"},"_resolved":"y:\\dev\\homecontrol\\Others\\deviceapi\\devdefs\\bobfrankston-devdefs-0.1.1.tgz","_integrity":"sha512-6CSgqcKBYv6ltPooPlNfwoWYA4abVjHnKVo8Rxfdpb8irdHWWs2IAZmLX0cO9SD86QzqFx6Ovbh2ze1ReNX2vA==","repository":{"url":"git+https://github.com/BobFrankston/devdefs.git","type":"git"},"_npmVersion":"11.7.0","description":"Shared base class for LAN device libraries (Wiz, LIFX, etc.)","directories":{},"_nodeVersion":"25.3.0","dependencies":{"@bobfrankston/udp-transport":"^1.0.2"},".dependencies":{"@bobfrankston/udp-transport":"file:../../../utils/udp/udp-transport"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/devdefs_0.1.1_1772068633492_0.6744551129862402","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@bobfrankston/devdefs","version":"0.1.2","keywords":["smart-home","device","base-class","lan"],"author":{"name":"Bob Frankston"},"license":"MIT","_id":"@bobfrankston/devdefs@0.1.2","maintainers":[{"name":"bobfrankston","email":"npm@bob.ma"}],"homepage":"https://github.com/BobFrankston/devdefs#readme","bugs":{"url":"https://github.com/BobFrankston/devdefs/issues"},"dist":{"shasum":"64a991bd2c25fb1390049c2fdcadddb4105663c5","tarball":"https://registry.npmjs.org/@bobfrankston/devdefs/-/devdefs-0.1.2.tgz","fileCount":6,"integrity":"sha512-As44U/fZ0GfbRH0MT45I6COInxhOYyiiIDnFplL4TY3A4XJiDyhAZWtjH+b38ZvQQyD+UNYtD+Kzhr4GuF7cqw==","signatures":[{"sig":"MEQCIF9Hy0nsve+PGnT5QLzdrb2gB6SPwVKuagMwlTCm3q1aAiACnRxGq3VyV0ciN2IpzxAJeXl8bA0cVRcg7FeLh4EZCQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6986},"main":"index.js","type":"module","_from":"file:bobfrankston-devdefs-0.1.2.tgz","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"scripts":{"build":"tsc","watch":"tsc -w","release":"npmglobalize"},"_npmUser":{"name":"bobfrankston","email":"npm@bob.ma"},"_resolved":"y:\\dev\\homecontrol\\Others\\deviceapi\\devdefs\\bobfrankston-devdefs-0.1.2.tgz","_integrity":"sha512-As44U/fZ0GfbRH0MT45I6COInxhOYyiiIDnFplL4TY3A4XJiDyhAZWtjH+b38ZvQQyD+UNYtD+Kzhr4GuF7cqw==","repository":{"url":"git+https://github.com/BobFrankston/devdefs.git","type":"git"},"_npmVersion":"11.7.0","description":"Shared base class for LAN device libraries (Wiz, LIFX, etc.)","directories":{},"_nodeVersion":"25.3.0","dependencies":{"@bobfrankston/udp-transport":"^1.0.2"},".dependencies":{"@bobfrankston/udp-transport":"file:../../../utils/udp/udp-transport"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/devdefs_0.1.2_1772068886174_0.13488669391908115","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@bobfrankston/devdefs","version":"0.1.3","keywords":["smart-home","device","base-class","lan"],"author":{"name":"Bob Frankston"},"license":"MIT","_id":"@bobfrankston/devdefs@0.1.3","maintainers":[{"name":"bobfrankston","email":"npm@bob.ma"}],"homepage":"https://github.com/BobFrankston/devdefs#readme","bugs":{"url":"https://github.com/BobFrankston/devdefs/issues"},"dist":{"shasum":"24553374842f11101d0480e3e644b08fbe79b421","tarball":"https://registry.npmjs.org/@bobfrankston/devdefs/-/devdefs-0.1.3.tgz","fileCount":6,"integrity":"sha512-UZuLjGigexoAlecjnYa5D3hx9ENr3Q7Yj42g5BbOe7SO1yGvvy11d/O8crbyG7mfQbcL03LUCTag5uIzg0syZA==","signatures":[{"sig":"MEYCIQDMC99XKaLVnSKMIAV23i8Ntf/fTIhy2GEIktn4tDWqxgIhAPvh/L+Vieo0I9N607EHE9hzg+IROdCYVhWHR5U30sSL","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8511},"main":"index.js","type":"module","_from":"file:bobfrankston-devdefs-0.1.3.tgz","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"scripts":{"build":"tsc","watch":"tsc -w","release":"npmglobalize"},"_npmUser":{"name":"bobfrankston","email":"npm@bob.ma"},"_resolved":"Y:\\dev\\homecontrol\\Others\\deviceapi\\devdefs\\bobfrankston-devdefs-0.1.3.tgz","_integrity":"sha512-UZuLjGigexoAlecjnYa5D3hx9ENr3Q7Yj42g5BbOe7SO1yGvvy11d/O8crbyG7mfQbcL03LUCTag5uIzg0syZA==","repository":{"url":"git+https://github.com/BobFrankston/devdefs.git","type":"git"},"_npmVersion":"11.7.0","description":"Shared base class for LAN device libraries (Wiz, LIFX, etc.)","directories":{},"_nodeVersion":"25.3.0","dependencies":{"@bobfrankston/udp-transport":"^1.0.2"},".dependencies":{"@bobfrankston/udp-transport":"file:../../../utils/udp/udp-transport"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/devdefs_0.1.3_1772070954859_0.23192921716474224","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@bobfrankston/devdefs","version":"0.1.4","keywords":["smart-home","device","base-class","lan"],"author":{"name":"Bob Frankston"},"license":"MIT","_id":"@bobfrankston/devdefs@0.1.4","maintainers":[{"name":"bobfrankston","email":"npm@bob.ma"}],"homepage":"https://github.com/BobFrankston/devdefs#readme","bugs":{"url":"https://github.com/BobFrankston/devdefs/issues"},"dist":{"shasum":"7f262952d96a7f21bd88c61e43726ab71d1090c6","tarball":"https://registry.npmjs.org/@bobfrankston/devdefs/-/devdefs-0.1.4.tgz","fileCount":6,"integrity":"sha512-gQc4FIEekGjD/vwtau6doWqTs/eUrbXd1cGDkLWyaVjUP2vJNyC92MqliF9BH82pFu0tOoDSUJXNJtlbIe40PQ==","signatures":[{"sig":"MEQCIH4pgkGxPCKcimsEp0ZV2u8fFk4dyJDDWZYFHowLobmGAiAn+PQxiH1jj9CT0X+uIk9QlBKlQBx1pVCr7NzvM0qu6Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8787},"main":"index.js","type":"module","_from":"file:bobfrankston-devdefs-0.1.4.tgz","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"scripts":{"build":"tsc","watch":"tsc -w","release":"npmglobalize"},"_npmUser":{"name":"bobfrankston","email":"npm@bob.ma"},"_resolved":"Y:\\dev\\homecontrol\\Others\\deviceapi\\devdefs\\bobfrankston-devdefs-0.1.4.tgz","_integrity":"sha512-gQc4FIEekGjD/vwtau6doWqTs/eUrbXd1cGDkLWyaVjUP2vJNyC92MqliF9BH82pFu0tOoDSUJXNJtlbIe40PQ==","repository":{"url":"git+https://github.com/BobFrankston/devdefs.git","type":"git"},"_npmVersion":"11.7.0","description":"Shared base class for LAN device libraries (Wiz, LIFX, etc.)","directories":{},"_nodeVersion":"25.3.0","dependencies":{"@bobfrankston/udp-transport":"^1.0.2"},".dependencies":{"@bobfrankston/udp-transport":"file:../../../utils/udp/udp-transport"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/devdefs_0.1.4_1772071482352_0.8885234736703314","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@bobfrankston/devdefs","version":"0.1.5","keywords":["smart-home","device","base-class","lan"],"author":{"name":"Bob Frankston"},"license":"MIT","_id":"@bobfrankston/devdefs@0.1.5","maintainers":[{"name":"bobfrankston","email":"npm@bob.ma"}],"homepage":"https://github.com/BobFrankston/devdefs#readme","bugs":{"url":"https://github.com/BobFrankston/devdefs/issues"},"dist":{"shasum":"ad27085d46c781973136cc7a272fffd89c1bd877","tarball":"https://registry.npmjs.org/@bobfrankston/devdefs/-/devdefs-0.1.5.tgz","fileCount":6,"integrity":"sha512-eSy1uzJSUYA43lK9d2BMgIQbmqTFkckbT4D0EFDpulwYAGgoKkx5J1S2NYY0Acsih676/wdW3JP2/J1WnnqiRg==","signatures":[{"sig":"MEUCICEMUUUDrztNHed7jDmCtoJN8y1avxf9wDv3ZP/Vwn4nAiEAjH7YzGo7sIH0DPUZ3Lv46uIRUfiWrOl+WuPWr/G5uDo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9756},"main":"index.js","type":"module","_from":"file:bobfrankston-devdefs-0.1.5.tgz","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"scripts":{"build":"tsc","watch":"tsc -w","release":"npmglobalize"},"_npmUser":{"name":"bobfrankston","email":"npm@bob.ma"},"_resolved":"Y:\\dev\\homecontrol\\Others\\deviceapi\\devdefs\\bobfrankston-devdefs-0.1.5.tgz","_integrity":"sha512-eSy1uzJSUYA43lK9d2BMgIQbmqTFkckbT4D0EFDpulwYAGgoKkx5J1S2NYY0Acsih676/wdW3JP2/J1WnnqiRg==","repository":{"url":"git+https://github.com/BobFrankston/devdefs.git","type":"git"},"_npmVersion":"11.7.0","description":"Shared base class for LAN device libraries (Wiz, LIFX, etc.)","directories":{},"_nodeVersion":"25.3.0","dependencies":{"@bobfrankston/colorlib":"^0.1.8","@bobfrankston/udp-transport":"^1.0.2"},".dependencies":{"@bobfrankston/colorlib":"file:../../../utils/colorlib","@bobfrankston/udp-transport":"file:../../../utils/udp/udp-transport"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/devdefs_0.1.5_1772157726961_0.2224909535419517","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@bobfrankston/devdefs","version":"0.1.6","description":"Shared base class for LAN device libraries (Wiz, LIFX, etc.)","type":"module","main":"index.js","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"scripts":{"build":"tsc","watch":"tsc -w","release":"npmglobalize"},"keywords":["smart-home","device","base-class","lan"],"author":{"name":"Bob Frankston"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/BobFrankston/devdefs.git"},"dependencies":{"@bobfrankston/colorlib":"^0.1.9","@bobfrankston/udp-transport":"^1.0.3"},"publishConfig":{"access":"public"},".dependencies":{"@bobfrankston/colorlib":"file:../../../utils/colorlib","@bobfrankston/udp-transport":"file:../../../utils/udp/udp-transport"},".transformedSnapshot":{"dependencies":{"@bobfrankston/colorlib":"^0.1.9","@bobfrankston/udp-transport":"^1.0.3"}},"_id":"@bobfrankston/devdefs@0.1.6","bugs":{"url":"https://github.com/BobFrankston/devdefs/issues"},"homepage":"https://github.com/BobFrankston/devdefs#readme","_integrity":"sha512-TFEpPjUmE3pEEsXTV46jVWYCYsO9PPlpZDOcp+6avnKbdG2MlENynf2HRZxV1LL9K/IB4TCot8MDL9aiuD08xw==","_resolved":"Y:\\dev\\homecontrol\\Others\\deviceapi\\devdefs\\bobfrankston-devdefs-0.1.6.tgz","_from":"file:bobfrankston-devdefs-0.1.6.tgz","_nodeVersion":"26.4.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-TFEpPjUmE3pEEsXTV46jVWYCYsO9PPlpZDOcp+6avnKbdG2MlENynf2HRZxV1LL9K/IB4TCot8MDL9aiuD08xw==","shasum":"b279fef7d8afc3ddab8d4233d930fb52e7dffd50","tarball":"https://registry.npmjs.org/@bobfrankston/devdefs/-/devdefs-0.1.6.tgz","fileCount":6,"unpackedSize":9905,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCyNkIlKBTH5F4lUmZQ7ee462tUXl7RhqnuaTJuNBLo2gIgHE7DotgcVJc8PqCzLcRyI+IfayandRp+CAbwx9V3D5Y="}]},"_npmUser":{"name":"bobfrankston","email":"npm@bob.ma"},"directories":{},"maintainers":[{"name":"bobfrankston","email":"npm@bob.ma"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/devdefs_0.1.6_1784462607455_0.8667185719564972"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-26T01:17:13.378Z","modified":"2026-07-19T12:03:27.749Z","0.1.1":"2026-02-26T01:17:13.651Z","0.1.2":"2026-02-26T01:21:26.329Z","0.1.3":"2026-02-26T01:55:55.002Z","0.1.4":"2026-02-26T02:04:42.491Z","0.1.5":"2026-02-27T02:02:07.106Z","0.1.6":"2026-07-19T12:03:27.588Z"},"bugs":{"url":"https://github.com/BobFrankston/devdefs/issues"},"author":{"name":"Bob Frankston"},"license":"MIT","homepage":"https://github.com/BobFrankston/devdefs#readme","keywords":["smart-home","device","base-class","lan"],"repository":{"type":"git","url":"git+https://github.com/BobFrankston/devdefs.git"},"description":"Shared base class for LAN device libraries (Wiz, LIFX, etc.)","maintainers":[{"name":"bobfrankston","email":"npm@bob.ma"}],"readme":"# @bobfrankston/devdefs\n\nShared base class and MAC utilities for LAN device protocol libraries.\n\n## DeviceBase\n\nCommon state and transport plumbing for LAN-controlled smart devices. Subclasses add protocol-specific commands.\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `mac` | `string` | MAC address (lowercase, colon-separated `aa:bb:cc:dd:ee:ff`) |\n| `ip` | `string` | Current IP address |\n| `port` | `number` | UDP port (set by subclass) |\n| `power` | `boolean` | On/off state |\n| `label` | `string` | User-assigned name |\n| `online` | `boolean` | Whether device is responding |\n| `lastSeen` | `number` | Timestamp of last message (Date.now()) |\n| `rssi` | `number` | WiFi signal strength (dBm) |\n| `fwVersion` | `string` | Firmware version (getter/setter — LxDevice decodes from numeric) |\n| `static MaxBrightness` | `100` | Shared brightness scale |\n\n| Getter | Type | Description |\n|--------|------|-------------|\n| `brightness` | `number` | Brightness 0-100 (subclass reads protocol-specific field) |\n\n| Method | Description |\n|--------|-------------|\n| `setPower(on)` | Set power on/off |\n| `setBrightness(level)` | Set brightness 0-100 |\n| `setWhite(temp, brightness?)` | Set white color temperature |\n| `requestState()` | Request current state (async — response via events) |\n| `setTransport(transport)` | Attach a `UdpTransport` |\n| `markSeen()` | Set `lastSeen = Date.now()`, `online = true` |\n| `requireTransport()` | Throw if no transport (protected, for subclass send paths) |\n| `requireIP()` | Throw if no IP (protected, for subclass send paths) |\n\nConstructor normalizes MAC from any format (colons, dashes, bare, upper/lower) to lowercase colon-separated.\n\n## MAC Utilities\n\n```typescript\nimport { mac12, macmac } from '@bobfrankston/devdefs';\n\nmac12('AA:BB:CC:DD:EE:FF');    // → 'aabbccddeeff'\nmac12('aa-bb-cc-dd-ee-ff');    // → 'aabbccddeeff'\nmac12('aabbccddeeff');         // → 'aabbccddeeff'\n\nmacmac('aabbccddeeff');        // → 'AA:BB:CC:DD:EE:FF'\nmacmac('aabbccddeeff', '-');   // → 'AA-BB-CC-DD-EE-FF'\n```\n\n## Usage\n\n`DeviceBase` is abstract — subclasses must implement `brightness`, `setPower`, `setBrightness`, `setWhite`, and `requestState`.\n\n```typescript\nimport { DeviceBase, mac12 } from '@bobfrankston/devdefs';\n\nclass MyDevice extends DeviceBase {\n    dimming: number = 0;\n\n    constructor(mac: string, ip?: string) {\n        super(mac, ip, 12345);\n    }\n\n    get brightness() { return this.dimming; }\n    setPower(on: boolean) { /* protocol send */ }\n    setBrightness(level: number) { /* protocol send */ }\n    setWhite(temp: number, brightness?: number) { /* protocol send */ }\n    requestState() { /* protocol send */ }\n}\n```\n\n## Packages using devdefs\n\n- [@bobfrankston/wzlan](../../Wiz/apps/wzlan) — Wiz LAN protocol\n- [@bobfrankston/lxlan](../../LifX/Apps/lxlan) — LIFX LAN protocol\n","readmeFilename":"README.md"}