Slide 47
Slide 47 text
Ext.define('Dash.ux.data.Lifx', {
singleton: true,
url: 'https://api.lifx.com/v1/lights/all',
token: 'lifx-oAuth-token-here',
pulse: function(config) {
var me = this,
data = {
power_on: true,
from_color: 'white',
color: config.color,
period: config.period,
cycles: config.cycles,
persist: false
};
Ext.Ajax.request({
url: me.url + '/effects/pulse',
method: 'POST',
jsonData: data,
headers: {
'Authorization': 'Bearer ' + me.token
}
});
}
});