Lifx is a platform that allows developers to build lightbulb-connected applications. With the Lifx API, you can control the color, brightness, and power of Lifx-connected lightbulbs. You can also create schedules and routines to automate your lightbulbs. Some examples of things you can build with the Lifx API include:
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
lifx: {
type: "app",
app: "lifx",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.lifx.com/v1/lights/all`,
headers: {
Authorization: `Bearer ${this.lifx.$auth.oauth_access_token}`,
},
})
},
})
Lifx uses OAuth authentication. When you connect your Lifx account, Pipedream will open a popup window where you can sign into Lifx and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Lifx API.
Pipedream requests the following authorization scopes when you connect your account:
remote_control:all
GET
https://cloud.lifx.com/oauth/authorize
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
POST
https://cloud.lifx.com/oauth/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}