Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

Commit

Permalink
hue light dropdown (fix #88, fix #87)
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Jan 17, 2020
1 parent 65b6002 commit 4694142
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nodes/hue-device.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@
return this.name ? 'node_label_italic' : '';
},
oneditprepare() {
const dev = this.device;
function getDevices() {
$.getJSON('zigbee-shepherd/hue?id=' + $('#node-input-shepherd').val(), data => {
$('#node-input-device').html('');
Object.keys(data).forEach(index => {
const device = data[index];
$('#node-input-device').append(`<option>${device.meta.name}</option>`);
$('#node-input-device').append(`<option ${dev === device.meta.name ? 'selected' : ''}>${device.meta.name}</option>`);
});
});
}
Expand Down

0 comments on commit 4694142

Please sign in to comment.