{"id":47725324,"url":"https://github.com/thatwest7014/lifx-lan-client-node","last_synced_at":"2026-04-06T00:01:02.766Z","repository":{"id":348365135,"uuid":"1196660273","full_name":"thatWest7014/LIFX-LAN-Client-Node","owner":"thatWest7014","description":"rather basic NPM package that allows for a pretty simple client for LIFX devices to be managed over LAN","archived":false,"fork":false,"pushed_at":"2026-03-31T21:52:41.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-04T23:18:38.441Z","etag":null,"topics":["home-automation","iot","lan","lifx","lifx-api","lifx-lan-protocol","lifx-lights","smart-light"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thatWest7014.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-30T23:13:01.000Z","updated_at":"2026-03-31T21:52:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/thatWest7014/LIFX-LAN-Client-Node","commit_stats":null,"previous_names":["thatwest7014/lifx-lan-client-node"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/thatWest7014/LIFX-LAN-Client-Node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thatWest7014%2FLIFX-LAN-Client-Node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thatWest7014%2FLIFX-LAN-Client-Node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thatWest7014%2FLIFX-LAN-Client-Node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thatWest7014%2FLIFX-LAN-Client-Node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thatWest7014","download_url":"https://codeload.github.com/thatWest7014/LIFX-LAN-Client-Node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thatWest7014%2FLIFX-LAN-Client-Node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31454200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"ssl_error","status_checked_at":"2026-04-05T21:22:51.943Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["home-automation","iot","lan","lifx","lifx-api","lifx-lan-protocol","lifx-lights","smart-light"],"created_at":"2026-04-02T20:18:11.808Z","updated_at":"2026-04-06T00:01:02.720Z","avatar_url":"https://github.com/thatWest7014.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lifx-lan\n[![Socket Badge](https://badge.socket.dev/npm/package/@west7014/lifx-lan/1.0.14)](https://badge.socket.dev/npm/package/@west7014/lifx-lan/1.0.14)\n\nControl LIFX lights directly over your local network using the [LIFX LAN protocol](https://lan.developer.lifx.com/). No cloud required for most features.\n\n## Installation\n\n```bash\nnpm install lifx-lan\n```\n\nIf you want to load your LIFX auth token from a `.env` file rather than hard-coding it:\n\n```bash\nnpm install dotenv@16.4.5\n```\n\n## Quick Start\n\n```js\nconst LifxLAN = require('lifx-lan');\n\nconst light = new LifxLAN('192.168.1.42');\n\nlight.on();\nlight.setColorHex(0xff6600);\nlight.setBrightnessPercent(80);\nlight.off(2000); // fade out over 2 seconds\n```\n\n## Authentication\n\nSome features (effects, fetching light metadata) use the [LIFX HTTP API](https://api.developer.lifx.com/) and require a personal access token from [cloud.lifx.com](https://cloud.lifx.com).\n\n**Option A — hard-code it:**\n```js\nconst AUTH = 'your-lifx-token-here';\nawait light.setEffect('flame', AUTH);\n```\n\n**Option B — load from `.env` (requires `dotenv@16.4.5`):**\n```\n# .env\nLIFX_TOKEN=your-lifx-token-here\n```\n```js\nrequire('dotenv').config();\nconst AUTH = process.env.LIFX_TOKEN;\nawait light.setEffect('flame', AUTH);\n```\n\nAll LAN-only methods (`on`, `off`, `setColor*`, `setBrightness*`, `setZones*`, `setTile*`) work without any token.\n\n## API\n\n### Constructor\n\n```js\nnew LifxLAN(ip, port = 56700)\n```\n\n### Power\n\n| Method | Description |\n|---|---|\n| `on(duration?)` | Turn light on |\n| `off(duration?)` | Turn light off |\n| `setPower(level, duration?)` | Raw power — `0` = off, `65535` = on |\n\n### Color\n\n| Method | Description |\n|---|---|\n| `setColor(hue, sat, bri, kelvin?, duration?)` | Set HSBK values directly (all 0–65535) |\n| `setColorRGB(r, g, b, kelvin?, duration?)` | Set color from RGB (0–255 each) |\n| `setColorHex(hex, kelvin?, duration?)` | Set color from hex e.g. `0xff6600` |\n\n### Brightness\n\n| Method | Description |\n|---|---|\n| `setBrightness(value, duration?)` | `0.0–1.0` or `0–65535` |\n| `setBrightnessPercent(percent, duration?)` | `0–100` |\n| `fadeBrightness(target, seconds)` | Smooth fade to brightness value |\n| `fadeBrightnessPercent(percent, seconds)` | Smooth fade to brightness percent |\n\n### Zones (multi-zone strips)\n\n| Method | Description |\n|---|---|\n| `setZones(start, end, h, s, b, kelvin?, duration?, apply?)` | Set zone range by HSBK |\n| `setZonesHex(start, end, hex, kelvin?, duration?, apply?)` | Set zone range by hex color |\n\n### Tile / Matrix (LIFX Ceiling)\n\n| Method | Description |\n|---|---|\n| `setTileState64(index, colors, duration?, x?, y?, width?)` | Set full 8×8 grid with an array of 64 HSBK objects |\n| `setTileSolid(index, h, s, b, kelvin?, duration?)` | Fill a tile with a solid HSBK color |\n| `setTileSolidHex(index, hex, kelvin?, duration?)` | Fill a tile with a solid hex color |\n\n### LIFX Ceiling — High-Level API\n\nThe ceiling has an 8×8 grid: 6 rows of 8 downlight zones, with uplight strips on the top and bottom edges.\n\n| Method | Description |\n|---|---|\n| `setAll(colors, kelvin?, duration?, mode?)` | Set entire ceiling — downlight + uplight |\n| `setDownlight(colors, kelvin?, duration?, mode?)` | Set downlight zones only |\n| `setUplight(color, kelvin?, duration?)` | Set uplight strips only |\n| `setZonesCustom(zoneColors, kelvin?, duration?)` | Set all 8 zones individually — array of 8 hex colors |\n\n`mode` can be `'solid'` (default), `'gradient'`, or `'palette'`. For `gradient` and `palette`, pass an array of hex colors.\n\n### HTTP API (requires auth token)\n\n| Method | Description |\n|---|---|\n| `getLightData(auth)` | Fetch light metadata from the LIFX cloud API |\n| `setEffect(fxName, auth, options?)` | Start an effect: `'pulse'`, `'breathe'`, `'move'`, `'morph'`, `'flame'` |\n| `stopEffect(auth)` | Stop any running effect |\n\n### Utilities\n\n| Method | Description |\n|---|---|\n| `rgbToHsbk(r, g, b, kelvin?)` | Convert RGB to a LIFX HSBK object |\n| `close()` | Close the underlying UDP socket |\n\n### Duration\n\nAll `duration` parameters are in **milliseconds** unless the method name says `seconds` (e.g. `fadeBrightness`).\n\n## TypeScript\n\nType declarations are included. No additional setup required.\n\n```ts\nimport LifxLAN, { HSBK, EffectName } from 'lifx-lan';\n```\n\n## License\n\nSee [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthatwest7014%2Flifx-lan-client-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthatwest7014%2Flifx-lan-client-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthatwest7014%2Flifx-lan-client-node/lists"}