Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions lifx/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Losant

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
65 changes: 65 additions & 0 deletions lifx/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# LIFX

Control [LIFX](https://www.lifx.com/) devices over the internet using the [LIFX HTTP API](https://api.developer.lifx.com/docs/).

## Input Configuration

* `LIFX App Token`: All requests to the LIFX API require an app token. You can generate an access token in your [account settings](https://cloud.lifx.com/settings). For more details, please refer to LIFX's [Authentication Documentation](https://api.developer.lifx.com/docs/authentication).
* `Action`: This node supports three API Actions:
* [List Lights](https://api.developer.lifx.com/docs/list-lights) - Filter the lights using [selectors](https://api.developer.lifx.com/docs/selectors).
* [Set State](https://api.developer.lifx.com/docs/set-state) - Sets the state of the lights within the selector.
* [Toggle](https://api.developer.lifx.com/docs/toggle-power) - Turn off lights if any of them are on, or turn them on if they are all off.
* `Selector`: [Lifx selectors](https://api.developer.lifx.com/docs/selectors) are an identifier for addressing one or many lights belonging to the authenticated account.
* `Body`: The [Set State](https://api.developer.lifx.com/docs/set-state) and [Toggle](https://api.developer.lifx.com/docs/toggle-power) actions support the ability to include a body with the request. See their respective documentation to see what to include in the body.

## Output Result
The result of all successful requests will include a `body` property. The `body` object contains the response data.

```json
{
"body":{
"results": [
{
"id": "f043d559273c",
"status": "ok",
"label": "LIFX Light"
}
]
}
}
```

If the request to LIFX's API fails, the `body` property will contain an `error` object with additional details.

```json
{
"body":{
"error": "Token required"
}
}
```

If the HTTP request fails, the `body` property will contain an `error` object with additional details.

```json
{
"error":{
"message": "Cannot resolve host: api.lifx.com",
}
}
```

## Version History

| Version | Date | Description |
| ------- | -------- | ---------------- |
| v1.0.0 | 9/18/2018 | Initial release. |

---

This node is developed and maintained by [Losant](https://www.losant.com). Please place issues, comments, or questions on the [Losant Forums](https://forums.losant.com).

Copyright © 2018 Losant IoT, Inc

https://www.losant.com

Loading