diff --git a/platypush/backend/http/static/js/light.hue.js b/platypush/backend/http/static/js/light.hue.js index 7ec0a4d18..65cb7768c 100644 --- a/platypush/backend/http/static/js/light.hue.js +++ b/platypush/backend/http/static/js/light.hue.js @@ -392,6 +392,7 @@ $(document).ready(function() { var $room = $('
') .addClass('room-item') .data('id', room) + .data('name', rooms[room].name) .text(rooms[room].name); var $roomLights = $('
') @@ -471,6 +472,8 @@ $(document).ready(function() { } updateRooms(groups); + }).then(function() { + initBindings(); }); }; @@ -644,11 +647,17 @@ $(document).ready(function() { $animationContainers.hide(); $animationContainer.show(); }); + + if (window.config.light.hue.default_group) { + var $defaultRoomItem = $roomsList.find('.room-item').filter( + (i, r) => $(r).data('name') == window.config.light.hue.default_group); + + $defaultRoomItem.click(); + } }; var init = function() { initUi(); - initBindings(); }; init(); diff --git a/platypush/backend/http/templates/plugins/light.hue.html b/platypush/backend/http/templates/plugins/light.hue.html index 1b395874e..07693d9de 100644 --- a/platypush/backend/http/templates/plugins/light.hue.html +++ b/platypush/backend/http/templates/plugins/light.hue.html @@ -1,6 +1,19 @@ +{% set default_group = configuration['groups'][0] if 'groups' in configuration else None %} + + +
Rooms