{"__v":1,"_id":"55f28173f9f3991900f38a21","category":{"__v":3,"_id":"55f28172f9f3991900f38a16","pages":["55f28173f9f3991900f38a1d","55f28173f9f3991900f38a1e","55f28173f9f3991900f38a1f","55f28173f9f3991900f38a20","55f28173f9f3991900f38a21","55f28173f9f3991900f38a22","55f28173f9f3991900f38a23","55f28173f9f3991900f38a24","55f28173f9f3991900f38a25","55f28173f9f3991900f38a26","55f28173f9f3991900f38a27","55f63d46fe4cce21005c785e","55f65cc16be5ea0d00bbbf4c"],"project":"54ebb40d6423300d003672c0","version":"55f28172f9f3991900f38a13","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-06-17T05:23:31.147Z","from_sync":false,"order":2,"slug":"api-endpoints","title":"API Endpoints"},"editedParams":true,"editedParams2":true,"project":"54ebb40d6423300d003672c0","user":"557e2561eb75d80d00af3dab","version":{"__v":2,"_id":"55f28172f9f3991900f38a13","project":"54ebb40d6423300d003672c0","createdAt":"2015-09-11T07:23:30.065Z","releaseDate":"2015-09-11T07:23:30.065Z","categories":["55f28172f9f3991900f38a14","55f28172f9f3991900f38a15","55f28172f9f3991900f38a16","55f66acb297b37170058accb"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"updates":["55aedb0f826d210d00041d79","5649022a6d89ea0d00e44058"],"next":{"pages":[],"description":""},"createdAt":"2015-06-17T06:19:20.821Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"curl -X POST \"https://api.lifx.com/v1/lights/all/effects/breathe\" \\\n     -H \"Authorization: Bearer [[app:Token]]\" \\\n     -d 'period=2' \\\n     -d 'cycles=5' \\\n     -d 'color=green'","language":"curl"},{"code":"<?php\n\n$link = \"https://api.lifx.com/v1/lights/all/effects/breathe\";\n$authToken = \"[[app:Token]]\";\n\n$headers = array('Authorization: Bearer ' . $authToken);\n$data = 'period=2&cycles=5&color=green';\n\n$ch = curl_init($link);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\ncurl_setopt($ch, CURLOPT_POST, true);\n$response = curl_exec($ch);\n\n?>","language":"php"},{"code":"import requests\n\ntoken = \"[[app:Token]]\"\n\nheaders = {\n    \"Authorization\": \"Bearer %s\" % token,\n}\n\ndata = {\n    \"period\": 2,\n    \"cycles\": 5,\n    \"color\": \"green\",\n}\n\nresponse = requests.post('https://api.lifx.com/v1/lights/all/effects/breathe', data=data, headers=headers)","language":"python"}]},"method":"post","results":{"codes":[{"name":"","code":"{\n  \"results\": [\n    {\n      \"id\": \"d3b2f2d97452\",\n      \"label\": \"Left Lamp\",\n      \"status\": \"ok\"\n    }\n  ]\n}","language":"json","status":"2XX"}]},"settings":"","auth":"required","params":[{"_id":"5581116804ae5b0d0026287d","ref":"","in":"path","required":true,"desc":"The [selector](doc:selectors) to limit which lights will run the effect.","default":"","type":"string","name":"selector"},{"_id":"558112dfa5474a0d00d94392","ref":"","in":"body","required":true,"desc":"The [color](doc:colors) to use for the breathe effect.","default":"","type":"string","name":"color"},{"_id":"558112dfa5474a0d00d94391","ref":"","in":"body","required":false,"desc":"The [color](doc:colors) to start the effect from. If this parameter is omitted then the color the bulb is currently set to is used instead.","default":"current bulb color","type":"string","name":"from_color"},{"_id":"558112dfa5474a0d00d94390","ref":"","in":"body","required":false,"desc":"The time in seconds for one cyles of the effect.","default":"1.0","type":"double","name":"period"},{"_id":"558112dfa5474a0d00d9438f","ref":"","in":"body","required":false,"desc":"The number of times to repeat the effect.","default":"1.0","type":"double","name":"cycles"},{"_id":"558112dfa5474a0d00d9438e","ref":"","in":"body","required":false,"desc":"If false set the light back to its previous value when effect ends, if true leave the last effect color.","default":"false","type":"boolean","name":"persist"},{"_id":"558112dfa5474a0d00d9438d","ref":"","in":"body","required":false,"desc":"If true, turn the bulb on if it is not already on.","default":"true","type":"boolean","name":"power_on"},{"_id":"558112dfa5474a0d00d9438c","ref":"","in":"body","required":false,"desc":"Defines where in a period the target color is at its maximum. Minimum `0.0`, maximum `1.0`.","default":"0.5","type":"double","name":"peak"}],"url":"/lights/:selector/effects/breathe"},"isReference":false,"order":5,"body":"Performs a breathe effect by slowly fading between the given colors. Use the parameters to tweak the effect.","excerpt":"","slug":"breathe-effect","type":"endpoint","title":"Breathe Effect"}

postBreathe Effect


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

selector:
required
string
The [selector](doc:selectors) to limit which lights will run the effect.

Body Params

color:
required
string
The [color](doc:colors) to use for the breathe effect.
from_color:
stringcurrent bulb color
The [color](doc:colors) to start the effect from. If this parameter is omitted then the color the bulb is currently set to is used instead.
period:
double1.0
The time in seconds for one cyles of the effect.
cycles:
double1.0
The number of times to repeat the effect.
persist:
booleanfalse
If false set the light back to its previous value when effect ends, if true leave the last effect color.
power_on:
booleantrue
If true, turn the bulb on if it is not already on.
peak:
double0.5
Defines where in a period the target color is at its maximum. Minimum `0.0`, maximum `1.0`.

Examples


Result Format


Documentation

Performs a breathe effect by slowly fading between the given colors. Use the parameters to tweak the effect.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}