{"id":19494717,"url":"https://github.com/ceejbot/nanoleaves","last_synced_at":"2025-04-25T21:32:05.141Z","repository":{"id":57307973,"uuid":"93905864","full_name":"ceejbot/nanoleaves","owner":"ceejbot","description":"CLI and api client for the Nanoleaf Aurora light panels.","archived":false,"fork":false,"pushed_at":"2018-11-30T23:57:12.000Z","size":103,"stargazers_count":27,"open_issues_count":2,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-11T19:22:03.207Z","etag":null,"topics":["aurora","iot","javascript","lights","nanoleaf","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ceejbot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-10T00:18:49.000Z","updated_at":"2023-03-02T06:53:57.000Z","dependencies_parsed_at":"2022-09-09T01:00:52.684Z","dependency_job_id":null,"html_url":"https://github.com/ceejbot/nanoleaves","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fnanoleaves","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fnanoleaves/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fnanoleaves/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceejbot%2Fnanoleaves/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ceejbot","download_url":"https://codeload.github.com/ceejbot/nanoleaves/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224018403,"owners_count":17242059,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aurora","iot","javascript","lights","nanoleaf","nodejs"],"created_at":"2024-11-10T21:32:22.395Z","updated_at":"2024-11-10T21:33:07.483Z","avatar_url":"https://github.com/ceejbot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nanoleaves\n\nA command-line tool for interacting with your Nanoleaf Aurora. Also includes a full API client for the Aurora!\n\n[![Build Status](https://travis-ci.org/ceejbot/nanoleaves.svg?branch=master)](https://travis-ci.org/ceejbot/nanoleaves) [![Coverage Status](https://coveralls.io/repos/github/ceejbot/nanoleaves/badge.svg?branch=master)](https://coveralls.io/github/ceejbot/nanoleaves?branch=master) [![on npm](http://img.shields.io/npm/v/nanoleaves.svg?style=flat)](https://www.npmjs.org/package/nanoleaves)\n\n## CLI usage\n\nProvide the IP address of your Aurora in the environment variable `AURORA_HOST` and your API access token in `AURORA_TOKEN`. If your AURORA is listening on an unusual port, use `AURORA_PORT`.\n\nTo generate a token, hold the power key until the light starts flashing, then run `nanoleaves token`.\n\n```\n$ nanoleaves --help\nCommands:\n  animation \u003cname\u003e          get details about the given animation effect\n  brightness [number]       get or set the overall brightness\n  effect [name]             get or set the current effect\n  effects                   list available effects\n  hsb \u003chue\u003e \u003csat\u003e \u003cbright\u003e  set the hue, sat, and brightness for all panels\n  hue [number]              get or set the hue for all panels\n  info                      get all available info about your Aurora\n  layout                    show the panel layout\n  mode                      get the current color mode for the Aurora\n  off                       turn your Aurora off\n  on                        turn your Aurora on\n  panels                    show the panel ids\n  random                    run a randomly-chosen effect\n  saturation [number]       get or set the overall saturation\n  temp [number]             get or set the overall color temperature\n  token                     generate a new API access token\n  upload \u003cfilename\u003e         upload a json file containing a new animation effect\n\nOptions:\n  --version  Show version number                                       [boolean]\n  --help     Show help                                                 [boolean]\n```\n\n## API usage\n\n```js\nconst AuroraAPI = require('nanoleaves');\nconst aurora = new AuroraAPI({\n    host: '10.0.0.2',\n    token: 'your-api-token'\n});\n\naurora.info().then(info =\u003e\n{\n    console.log(info);\n});\n```\n\nThe constructor will default to the values in the above-mentioned environment variables if present.\n\nAll API functions return promises.\n\n* `newToken()` - generate a new API token\n* `info()` - return all info about the Aurora\n* `identify()` - flash panels\n* `animation(name)` - get detailed information about a specific animation effect\n* `brightness()` - get the brightness for all panels\n* `setBrightness(v)` - set the brightness for all panels; 0-100\n* `effect()` - get the name of the current effect\n* `effects()` - return a list of the names of all effects\n* `setEffect(name)` - set the active effect by name\n* `hue()` - get the hue for all panels\n* `setHue(v)` - set the hue for all panels; 0-360\n* `layout()` - get panel layout data\n* `mode()` - get the Aurora's current color mode\n* `off()` - turn the Aurora off\n* `on()` - turn the Aurora on\n* `orientation()` - get the global orientation; 0-360\n* `saturation()`  - get the saturation for all panels\n* `setSaturation(v)` - set the saturation for all panels; 0-100\n* `temperature()` - get the color temperature for all panels\n* `setTemperature(v)` - set the color temperature for all panels; 1200-6500\n* `addAnimation(json)` - store a new animation effect on the Aurora\n* `setStaticPanel(data)` - set a panel or a list of panels to a static color; see below\n\n## Static panel structure\n\nThe `setStaticPanel()` function pokes a single color into a specific panel. It is only useful for single frame static displays.  You can call this a couple of ways. This snippet sets panel id 100 to black:\n\n```js\nconst panel = { id: '100', r: 0,  g: 0,  b: 0 };\naurora.setStaticPanel(panel);\n```\n\nThis code does the equivalent with a full panel object:\n\n```js\nconst Aurora = require('nanoleaves');\n\nconst aurora = new Aurora();\nconst panel = new Aurora.Panel('100');\npanel.frames = [{ r: 0, g: 0, b: 0, w: 0, transition: 50}];\n\naurora.setStaticPanel(panel);\n```\n\nYou can also send a list of panels to `setStaticPanel()`:\n\n```js\nconst list = [\n\t{ id: 71, r: 255, g: 0, b: 0, transition: 50 },\n\t{ id: 26, r: 255, g: 51, b: 17, transition: 50 },\n\t{ id: 72, r: 255, g: 102, b: 68, transition: 50 },\n\t{ id: 167, r: 255, g: 153, b: 51, transition: 50 },\n];\naurora.setStaticPanel(list);\n```\n\nThere's an example of setting an entire static animation display in [examples/static-display.js](examples/static-display.js). Use `nanoleaves panels` to get a list of valid panel ids for your setup.\n\n## License\n\nISC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceejbot%2Fnanoleaves","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceejbot%2Fnanoleaves","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceejbot%2Fnanoleaves/lists"}