Small Hue improvements (#235)

* Small Hue Bridge improvements

* Small Lang fixing
This commit is contained in:
b1rdhous3
2016-09-11 22:20:57 +02:00
committed by redPanther
parent 0b8d41ed69
commit d097995a74
5 changed files with 60 additions and 52 deletions

View File

@@ -197,3 +197,18 @@ function requestWriteConfig(config, create, overwrite)
var overwrite = (typeof overwrite !== 'undefined') ? overwrite : false;
websocket.send('{"command":"config","subcommand":"setconfig", "tan":'+wsTan+', "config":'+JSON.stringify(config)+',"create":'+create+', "overwrite":'+overwrite+'}');
}
function get_hue_lights(){
$.ajax({
type: "GET",
url: 'http://'+$("#ip").val()+'/api/'+$("#user").val()+'/lights',
processData: false,
contentType: 'application/json',
success: function(r) {
for(var lightid in r){
//console.log(r[lightid].name);
$('#hue_lights').append('ID: '+lightid+' Name: '+r[lightid].name+'<br />');
}
}
});
}