I am using my lifx light as a weather alert.
When the alert is activated, I send it with;
var url =
`${LIFX_HOST}/v1/lights/${lightNumber}/effects/breathe`;
var color = 'hue:299.54 saturation:1.0 brightness:0.37';
var from_color = 'hue:299.54 saturation:1.0 brightness:0.01';
// sec
var period = 5;
// set it to last 3 hours
var cycles = (ALERT_RUN_HOURS * 60 * 60) / period;
var persist = 'true';
var request_data = {
"color": color,
"from_color": from_color,
"period": period,
"cycles": cycles,
"persist": persist,
"power_on": true,
"peak": 0.4
};
I can’t get the cycles time right, so after this api is sent I just send a timed shutoff
var url =
`${LIFX_HOST}/v1/lights/${LIGHT}/state`;
var request_data = {
"power": "off",
"duration": duration
};
My question is, is it possible for me to clear out the breath effect in memory when the power: off
state activates?