Skip to content

Commit 00be58c

Browse files
committed
Merge branch 'development' of github.com:domoticz/domoticz into development
2 parents c46faa9 + e3ac352 commit 00be58c

File tree

3 files changed

+37
-25
lines changed

3 files changed

+37
-25
lines changed

hardware/SatelIntegra.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,9 @@ bool SatelIntegra::ReadZonesState(const bool firstTime)
401401
zonesCount = 128;
402402
}
403403

404-
unsigned char cmd[1];
404+
unsigned char cmd[2];
405405
cmd[0] = 0x00; // read zones violation
406-
if (SendCommand(cmd, 1, buffer, 17 + m_data32 * 16) > 0)
406+
if (SendCommand(cmd, 1 + m_data32, buffer, 17 + m_data32 * 16) > 0)
407407
{
408408
bool violate;
409409
unsigned int byteNumber;
@@ -542,9 +542,9 @@ bool SatelIntegra::ReadOutputsState(const bool firstTime)
542542
#endif
543543
unsigned char buffer[33];
544544

545-
unsigned char cmd[1];
545+
unsigned char cmd[2];
546546
cmd[0] = 0x17; // read outputs state
547-
if (SendCommand(cmd, 1, buffer, 17 + m_data32 * 16) > 0)
547+
if (SendCommand(cmd, 1 + m_data32, buffer, 17 + m_data32 * 16) > 0)
548548
{
549549
bool findBlindOutput = false;
550550
bool outputState;

www/app/LightsController.js

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
define(['app'], function (app) {
2-
app.controller('LightsController', ['$scope', '$rootScope', '$location', '$http', '$interval', 'permissions', function ($scope, $rootScope, $location, $http, $interval, permissions) {
2+
app.controller('LightsController', function ($scope, $rootScope, $location, $http, $interval, $route, $routeParams, permissions) {
3+
var $element = $('#main-view #lightcontent').last();
4+
35
$scope.HasInitializedAddManualDialog = false;
46

57
MakeFavorite = function (id, isfavorite) {
@@ -849,9 +851,10 @@ define(['app'], function (app) {
849851

850852
var i = 0;
851853
var j = 0;
854+
var roomPlanId = $routeParams.room || window.myglobals.LastPlanSelected;
852855

853856
$.ajax({
854-
url: "json.htm?type=devices&filter=light&used=true&order=[Order]&plan=" + window.myglobals.LastPlanSelected,
857+
url: "json.htm?type=devices&filter=light&used=true&order=[Order]&plan=" + roomPlanId,
855858
async: false,
856859
dataType: 'json',
857860
success: function (data) {
@@ -1401,28 +1404,33 @@ define(['app'], function (app) {
14011404
htmlcontent = '<h2>' + $.t('No Lights/Switches found or added in the system...') + '</h2>';
14021405
}
14031406
$('#modal').hide();
1404-
$('#lightcontent').html(tophtm + htmlcontent);
1405-
$('#lightcontent').i18n();
1407+
$element.html(tophtm + htmlcontent);
1408+
$element.i18n();
14061409
if (bShowRoomplan == true) {
14071410
$.each($.RoomPlans, function (i, item) {
14081411
var option = $('<option />');
14091412
option.attr('value', item.idx).text(item.name);
1410-
$("#lightcontent #comboroom").append(option);
1413+
$element.find("#comboroom").append(option);
14111414
});
1412-
if (typeof window.myglobals.LastPlanSelected != 'undefined') {
1413-
$("#lightcontent #comboroom").val(window.myglobals.LastPlanSelected);
1415+
if (typeof roomPlanId != 'undefined') {
1416+
$element.find("#comboroom").val(roomPlanId);
14141417
}
1415-
$("#lightcontent #comboroom").change(function () {
1416-
var idx = $("#lightcontent #comboroom option:selected").val();
1418+
$element.find("#comboroom").change(function () {
1419+
var idx = $element.find("#comboroom option:selected").val();
14171420
window.myglobals.LastPlanSelected = idx;
1418-
ShowLights();
1421+
1422+
$route.updateParams({
1423+
room: idx > 0 ? idx : undefined
1424+
});
1425+
$location.replace();
1426+
$scope.$apply();
14191427
});
14201428
}
14211429

14221430
if ($scope.config.AllowWidgetOrdering == true) {
14231431
if (permissions.hasPermission("Admin")) {
14241432
if (window.myglobals.ismobileint == false) {
1425-
$("#lightcontent .span4").draggable({
1433+
$element.find(".span4").draggable({
14261434
drag: function () {
14271435
if (typeof $scope.mytimer != 'undefined') {
14281436
$interval.cancel($scope.mytimer);
@@ -1433,10 +1441,10 @@ define(['app'], function (app) {
14331441
},
14341442
revert: true
14351443
});
1436-
$("#lightcontent .span4").droppable({
1444+
$element.find(".span4").droppable({
14371445
drop: function () {
14381446
var myid = $(this).attr("id");
1439-
var roomid = $("#lightcontent #comboroom option:selected").val();
1447+
var roomid = $element.find("#comboroom option:selected").val();
14401448
if (typeof roomid == 'undefined') {
14411449
roomid = 0;
14421450
}
@@ -1456,7 +1464,7 @@ define(['app'], function (app) {
14561464
$rootScope.RefreshTimeAndSun();
14571465

14581466
//Create Dimmer Sliders
1459-
$('#lightcontent .dimslider').slider({
1467+
$element.find('.dimslider').slider({
14601468
//Config
14611469
range: "min",
14621470
min: 0,
@@ -1527,7 +1535,7 @@ define(['app'], function (app) {
15271535
$scope.ResizeDimSliders();
15281536

15291537
//Create Selector selectmenu
1530-
$('#lightcontent .selectorlevels select').selectmenu({
1538+
$element.find('.selectorlevels select').selectmenu({
15311539
//Config
15321540
width: '75%',
15331541
value: 0,
@@ -1545,7 +1553,7 @@ define(['app'], function (app) {
15451553
select$.selectmenu("menuWidget").addClass('selectorlevels-menu');
15461554
select$.val(level);
15471555

1548-
$('#lightcontent #' + idx + " #bigtext").html(unescape(levelname));
1556+
$element.find('#' + idx + " #bigtext").html(unescape(levelname));
15491557
},
15501558
change: function (event, ui) { //When the user selects an option
15511559
var select$ = $(this),
@@ -1568,13 +1576,13 @@ define(['app'], function (app) {
15681576
}
15691577

15701578
$scope.ResizeDimSliders = function () {
1571-
var nobj = $("#lightcontent #name");
1579+
var nobj = $element.find("#name");
15721580
if (typeof nobj == 'undefined') {
15731581
return;
15741582
}
15751583
var width = nobj.width() - 50;
1576-
$("#lightcontent .dimslider").width(width);
1577-
$("#lightcontent .dimsmall").width(width - 48);
1584+
$element.find(".dimslider").width(width);
1585+
$element.find(".dimsmall").width(width - 48);
15781586
}
15791587

15801588
$.strPad = function (i, l, s) {
@@ -2368,6 +2376,7 @@ define(['app'], function (app) {
23682376

23692377
ShowLights();
23702378
};
2379+
23712380
$scope.$on('$destroy', function () {
23722381
if (typeof $scope.mytimer != 'undefined') {
23732382
$interval.cancel($scope.mytimer);
@@ -2383,5 +2392,5 @@ define(['app'], function (app) {
23832392
popup.hide();
23842393
}
23852394
});
2386-
}]);
2395+
});
23872396
});

www/app/log/components/DeviceOnOffChart.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ define(['app', 'luxon'], function (app, luxon) {
5252
var chartData = [];
5353

5454
getFilteredData(data).forEach(function (point, index, points) {
55-
if (point.Status === 'On' || (point.Status.includes('Set Level') && point.Level > 0)) {
55+
if (point.Status === 'On'
56+
|| (point.Status.includes('Set Level') && point.Level > 0)
57+
|| (point.Status.includes('Set Color'))
58+
) {
5659
chartData.push({
5760
x: DateTime.fromFormat(point.Date, dzSettings.serverDateFormat).valueOf(),
5861
x2: points[index + 1] ? DateTime.fromFormat(points[index + 1].Date, dzSettings.serverDateFormat).valueOf() : Date.now(),

0 commit comments

Comments
 (0)