Skip to content

Commit 42210d5

Browse files
committed
v1.1-beta.504
- Added Z-Wave "Send to sleep" option to "Query on Wake Up" program - Added SendToSleep command after each WakeUp query for battery powered device - Added custom serial port path selector for various serial interfaces (z-wave, x10, w800rf, insteon) - Updated FibaroRGBW app - Fixed ZWaveLib packet fragmentation issue (affecting RaZberry) and timeout errors occurring with some devices (eg. Fibaro in wall switches) - Fixed "event stream disconnected" issue occurring on some mono-arm platforms - Removed 20 seconds pause after backup restore/factory reset - Fix modules serialization bug (backslash character not escaped)
1 parent 10a5db1 commit 42210d5

25 files changed

Lines changed: 334 additions & 107 deletions

File tree

2.25 KB
Binary file not shown.

BaseFiles/Common/html/pages/configure/interfaces/configlet/insteon.html

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,41 @@
6868
// populate port list
6969
HG.Configure.Interfaces.ServiceCall('Hardware.SerialPorts', function (ports) {
7070
portSelect.empty().append('<option value="">' + HG.WebApp.Locales.GetLocaleString('systemsettings_selectport_placeholder') + '</option>');
71+
portSelect.append('<option value="" data-ui-action="custom">(enter custom port)</option>');
7172
for (var p = 0; p < ports.length; p++) {
7273
portSelect.append('<option value="' + ports[p] + '">' + ports[p] + '</option>');
7374
}
7475
portSelect.selectmenu('refresh', true);
7576
// set current configured port
7677
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Get', 'Port', '', function (port) {
78+
var opt = portSelect.find('option[value="'+port.ResponseValue+'"]');
79+
if (opt.length == 0) {
80+
// custom port
81+
portSelect.find('option').eq(1).val(port.ResponseValue);
82+
portSelect.find('option').eq(1).html(port.ResponseValue);
83+
portSelect.selectmenu('refresh', true);
84+
}
7785
portSelect.val(port.ResponseValue);
7886
portSelect.selectmenu('refresh', true);
7987
});
8088
});
89+
// bind to port select change event
90+
portSelect.change(function (event) {
91+
if ($(this)[0].selectedIndex == 1) {
92+
var port = $(this).find('option').eq(1).text();
93+
if (port == '(enter custom port)') port = '';
94+
port = prompt("Please enter port path", port);
95+
$(this).find('option').eq(1).val(port);
96+
if (port != '' && port != '(enter custom port)') {
97+
$(this).find('option').eq(1).html(port);
98+
} else {
99+
$(this).val('');
100+
$(this).find('option').eq(1).html('(enter custom port)');
101+
}
102+
$(this).selectmenu('refresh', true);
103+
}
104+
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Set', 'Port', encodeURIComponent($(this).val()));
105+
});
81106
// populate selected house codes
82107
HG.Configure.MIG.InterfaceCommand(this.Id, 'Options.Get', 'HouseCodes', '', function (data) {
83108
data = ',' + data.ResponseValue + ',';
@@ -91,10 +116,6 @@
91116
});
92117
housecodeButtons.find('input[type=checkbox]').checkboxradio('refresh');
93118
});
94-
// bind to port select change event
95-
portSelect.change(function (event) {
96-
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Set', 'Port', encodeURIComponent($(this).val()));
97-
});
98119
// bind to house code change event
99120
housecodeButtons.find('input[type=checkbox]').change(function (event) {
100121
var hc = _this.GetHouseCodeSelection();

BaseFiles/Common/html/pages/configure/interfaces/configlet/w800rf.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,39 @@
4444
// populate port list
4545
HG.Configure.Interfaces.ServiceCall('Hardware.SerialPorts', function (ports) {
4646
portSelect.empty().append('<option value="">' + HG.WebApp.Locales.GetLocaleString('systemsettings_selectport_placeholder') + '</option>');
47+
portSelect.append('<option value="" data-ui-action="custom">(enter custom port)</option>');
4748
for (var p = 0; p < ports.length; p++) {
4849
portSelect.append('<option value="' + ports[p] + '">' + ports[p] + '</option>');
4950
}
5051
portSelect.selectmenu('refresh', true);
5152
// set current configured port
5253
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Get', 'Port', '', function (port) {
54+
var opt = portSelect.find('option[value="'+port.ResponseValue+'"]');
55+
if (opt.length == 0) {
56+
// custom port
57+
portSelect.find('option').eq(1).val(port.ResponseValue);
58+
portSelect.find('option').eq(1).html(port.ResponseValue);
59+
portSelect.selectmenu('refresh', true);
60+
}
5361
portSelect.val(port.ResponseValue);
5462
portSelect.selectmenu('refresh', true);
5563
});
5664
});
5765
// bind to port select change event
5866
portSelect.change(function (event) {
67+
if ($(this)[0].selectedIndex == 1) {
68+
var port = $(this).find('option').eq(1).text();
69+
if (port == '(enter custom port)') port = '';
70+
port = prompt("Please enter port path", port);
71+
$(this).find('option').eq(1).val(port);
72+
if (port != '' && port != '(enter custom port)') {
73+
$(this).find('option').eq(1).html(port);
74+
} else {
75+
$(this).val('');
76+
$(this).find('option').eq(1).html('(enter custom port)');
77+
}
78+
$(this).selectmenu('refresh', true);
79+
}
5980
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Set', 'Port', encodeURIComponent($(this).val()));
6081
});
6182
},

BaseFiles/Common/html/pages/configure/interfaces/configlet/x10.html

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,42 @@
6868
// populate port list
6969
HG.Configure.Interfaces.ServiceCall('Hardware.SerialPorts', function (ports) {
7070
portSelect.empty().append('<option value="">' + HG.WebApp.Locales.GetLocaleString('systemsettings_selectport_placeholder') + '</option>');
71+
portSelect.append('<option value="" data-ui-action="custom">(enter custom port)</option>');
7172
portSelect.append('<option value="USB">CM15 Pro - USB</option>');
7273
for (var p = 0; p < ports.length; p++) {
7374
portSelect.append('<option value="' + ports[p] + '">CM11 - ' + ports[p] + '</option>');
7475
}
7576
portSelect.selectmenu('refresh', true);
7677
// set current configured port
7778
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Get', 'Port', '', function (port) {
79+
var opt = portSelect.find('option[value="'+port.ResponseValue+'"]');
80+
if (opt.length == 0) {
81+
// custom port
82+
portSelect.find('option').eq(1).val(port.ResponseValue);
83+
portSelect.find('option').eq(1).html(port.ResponseValue);
84+
portSelect.selectmenu('refresh', true);
85+
}
7886
portSelect.val(port.ResponseValue);
7987
portSelect.selectmenu('refresh', true);
8088
});
8189
});
90+
// bind to port select change event
91+
portSelect.change(function (event) {
92+
if ($(this)[0].selectedIndex == 1) {
93+
var port = $(this).find('option').eq(1).text();
94+
if (port == '(enter custom port)') port = '';
95+
port = prompt("Please enter port path", port);
96+
$(this).find('option').eq(1).val(port);
97+
if (port != '' && port != '(enter custom port)') {
98+
$(this).find('option').eq(1).html(port);
99+
} else {
100+
$(this).val('');
101+
$(this).find('option').eq(1).html('(enter custom port)');
102+
}
103+
$(this).selectmenu('refresh', true);
104+
}
105+
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Set', 'Port', encodeURIComponent($(this).val()));
106+
});
82107
// populate selected house codes
83108
HG.Configure.MIG.InterfaceCommand(this.Id, 'Options.Get', 'HouseCodes', '', function (data) {
84109
data = ',' + data.ResponseValue + ',';
@@ -92,10 +117,6 @@
92117
});
93118
housecodeButtons.find('input[type=checkbox]').checkboxradio('refresh');
94119
});
95-
// bind to port select change event
96-
portSelect.change(function (event) {
97-
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Set', 'Port', encodeURIComponent($(this).val()));
98-
});
99120
// bind to house code change event
100121
housecodeButtons.find('input[type=checkbox]').change(function (event) {
101122
var hc = _this.GetHouseCodeSelection();

BaseFiles/Common/html/pages/configure/interfaces/configlet/zwave.html

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
<select data-ui-field="serialport" data-mini="true"></select>
1010
</div>
1111
</td>
12+
<!-- TODO: deprecate this block -->
13+
<!--
1214
<td style="padding-right:20px">
1315
<span data-locale-id="startup_discovery">Discovery on Startup</span>
1416
<div data-role="controlgroup" data-type="horizontal" data-mini="true">
@@ -33,6 +35,7 @@
3335
</select>
3436
</div>
3537
</td>
38+
-->
3639
</tr></table>
3740
</div>
3841
<div class="ui-block-b" align="right" style="width:20%">
@@ -112,14 +115,15 @@ <h2 data-ui-field="nodeid" align="center"></h2>
112115
this.NodeOperationPopup = configlet.find('[data-ui-field=nodeoperation_popup]');
113116
// local fields
114117
var portSelect = configlet.find('[data-ui-field=serialport]');
115-
var delaySelect = configlet.find('[data-ui-field=commanddelay]');
116-
var startupDiscoverySelect = configlet.find('[data-ui-field=startupdiscovery]');
117118
var enabledFlip = configlet.find('[data-ui-field=isenabled]');
118119
var discoveryButton = configlet.find('[data-ui-field=discovery_btn]');
119120
var healNetworkButton = configlet.find('[data-ui-field=healnetwork_btn]');
120121
var addNodeButton = configlet.find('[data-ui-field=addnode_btn]');
121122
var removeNodeButton = configlet.find('[data-ui-field=removenode_btn]');
122123
var hardResetButton = configlet.find('[data-ui-field=hardreset_btn]');
124+
// TODO: deprecate the following two fields
125+
//var delaySelect = configlet.find('[data-ui-field=commanddelay]');
126+
//var startupDiscoverySelect = configlet.find('[data-ui-field=startupdiscovery]');
123127
// get enabled status
124128
HG.Configure.MIG.InterfaceCommand(_this.Id, 'IsEnabled.Get', '', '', function (data) {
125129
enabledFlip.val(data.ResponseValue).slider('refresh');
@@ -134,7 +138,7 @@ <h2 data-ui-field="nodeid" align="center"></h2>
134138
}
135139
});
136140
});
137-
141+
/*
138142
startupDiscoverySelect.selectmenu().selectmenu('refresh', true);
139143
// get current configured startup discovery
140144
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Get', 'StartupDiscovery', '', function (startupDiscovery) {
@@ -147,7 +151,6 @@ <h2 data-ui-field="nodeid" align="center"></h2>
147151
startupDiscoverySelect.change(function (event) {
148152
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Set', 'StartupDiscovery', encodeURIComponent($(this).val()));
149153
});
150-
151154
delaySelect.selectmenu().selectmenu('refresh', true);
152155
// get current configured delay
153156
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Get', 'Delay', '', function (delay) {
@@ -160,11 +163,12 @@ <h2 data-ui-field="nodeid" align="center"></h2>
160163
delaySelect.change(function (event) {
161164
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Set', 'Delay', encodeURIComponent($(this).val()));
162165
});
163-
166+
*/
164167
// populate serial port list
165168
HG.Configure.Interfaces.ServiceCall('Hardware.SerialPorts', function (ports) {
166169
portSelect.empty();
167170
portSelect.append('<option value="">' + HG.WebApp.Locales.GetLocaleString('systemsettings_selectport_placeholder', false, this.Locale) + '</option>');
171+
portSelect.append('<option value="" data-ui-action="custom">(enter custom port)</option>');
168172
if (ports.length == 0) {
169173
portSelect.append('<option value="">NO SERIAL PORTS FOUND</option>');
170174
} else {
@@ -175,12 +179,32 @@ <h2 data-ui-field="nodeid" align="center"></h2>
175179
portSelect.selectmenu('refresh', true);
176180
// set current configured port
177181
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Get', 'Port', '', function (port) {
182+
var opt = portSelect.find('option[value="'+port.ResponseValue+'"]');
183+
if (opt.length == 0) {
184+
// custom port
185+
portSelect.find('option').eq(1).val(port.ResponseValue);
186+
portSelect.find('option').eq(1).html(port.ResponseValue);
187+
portSelect.selectmenu('refresh', true);
188+
}
178189
portSelect.val(port.ResponseValue);
179190
portSelect.selectmenu('refresh', true);
180191
});
181192
});
182193
// bind to port select change event
183194
portSelect.change(function (event) {
195+
if ($(this)[0].selectedIndex == 1) {
196+
var port = $(this).find('option').eq(1).text();
197+
if (port == '(enter custom port)') port = '';
198+
port = prompt("Please enter port path", port);
199+
$(this).find('option').eq(1).val(port);
200+
if (port != '' && port != '(enter custom port)') {
201+
$(this).find('option').eq(1).html(port);
202+
} else {
203+
$(this).val('');
204+
$(this).find('option').eq(1).html('(enter custom port)');
205+
}
206+
$(this).selectmenu('refresh', true);
207+
}
184208
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Set', 'Port', encodeURIComponent($(this).val()));
185209
});
186210
// bind to button actions

BaseFiles/Common/html/pages/configure/maintenance/_maintenance.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,8 @@ HG.WebApp.Maintenance.InitializePage = function () {
198198
$.mobile.loading('show', { text: 'Resetting to factory defaults, please wait...', textVisible: true, theme: 'a', html: '' });
199199
// FACTORY RESET....
200200
HG.Configure.System.ServiceCall("System.ConfigurationReset", function (data) {
201-
setTimeout(function() {
202-
$.mobile.loading('hide');
203-
alert('Factory Reset Completed!');
204-
window.location.replace("/");
205-
}, 20000);
201+
$.mobile.loading('hide');
202+
window.location.replace("/");
206203
});
207204
});
208205
$('#systemsettings_backuprestores1selectallbtn').bind('click', function () {
@@ -247,10 +244,8 @@ HG.WebApp.Maintenance.InitializePage = function () {
247244
$('#systemsettings_backuprestores1confirmbutton').addClass('ui-disabled');
248245
$.mobile.loading('show', { text: 'Please be patient, this may take some time...', textVisible: true, theme: 'a', html: '' });
249246
HG.Configure.System.ServiceCall("System.ConfigurationRestoreS2/" + HG.WebApp.Maintenance.RestoreProgramList, function (data) {
250-
setTimeout(function() {
251-
window.location.replace("/");
252-
$.mobile.loading('hide');
253-
}, 20000);
247+
$.mobile.loading('hide');
248+
window.location.replace("/");
254249
});
255250
});
256251
});

BaseFiles/Common/html/pages/configure/widgeteditor/_widgetedit.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ HG.WebApp.WidgetEditor.InitializePage = function () {
117117
var module = HG.WebApp.Data.Modules[m];
118118
var widget = HG.WebApp.Utility.GetModulePropertyByName(module, 'Widget.DisplayModule');
119119
if (widget != null) widget = widget.Value;
120-
if (widget == HG.WebApp.WidgetsList._currentWidget)
120+
var devType = module.DeviceType.toLowerCase();
121+
var widgetType = HG.WebApp.WidgetsList._currentWidget.toLowerCase().split('/');
122+
widgetType = widgetType[widgetType.length-1];
123+
if (widget == HG.WebApp.WidgetsList._currentWidget || widgetType == devType)
121124
{
122125
selected = m;
123126
// prefer modules to programs as default bind module
@@ -136,7 +139,10 @@ HG.WebApp.WidgetEditor.InitializePage = function () {
136139
}
137140
var widget = HG.WebApp.Utility.GetModulePropertyByName(module, 'Widget.DisplayModule');
138141
if (widget != null) widget = widget.Value;
139-
if (widget == HG.WebApp.WidgetsList._currentWidget || selected == '')
142+
var devType = module.DeviceType.toLowerCase();
143+
var widgetType = HG.WebApp.WidgetsList._currentWidget.toLowerCase().split('/');
144+
widgetType = widgetType[widgetType.length-1];
145+
if (widget == HG.WebApp.WidgetsList._currentWidget || widgetType == devType || selected == '')
140146
{
141147
bindModuleSelect.append('<option value="' + m + '">' + name + '</option>');
142148
}

BaseFiles/Common/html/pages/control/main.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- Control -->
2-
<div data-ui-field="wallpaper" style="position:fixed;width:100%;height:100%;"></div>
2+
<div data-ui-field="wallpaper" style="position:fixed;width:100%;height:100%;background-position:center;-webkit-background-size:cover;-moz-background-size:cover;background-size:cover;-o-background-size:cover;"></div>
33
<div data-role="page" id="page_control" data-upload-dropzone="wallpaper" style="background:none">
44

55
<div id="control_macrorecord_optionspopup" class="hg-popup-a" data-role="popup" data-overlay-theme="b">

BaseFiles/Common/html/pages/control/widgets/DaniMail/fibaro/rgbw.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
var srgbcolor = red + "," + green + "," + blue;
9191
_this.ControlImage.clear();_this.ControlImage.ball(12, 12, 12, color);
9292
//
93-
HG.Control.Modules.ServiceCall("Control.ColorHsb",module.Domain, module.Address, srgbcolor, function (data) { });
93+
HG.Control.Modules.ServiceCall("Control.ColorRgb",module.Domain, module.Address, srgbcolor, function (data) { });
9494
});
9595
}
9696
//
@@ -136,7 +136,7 @@
136136
} else {
137137
this.IconImage = 'pages/control/widgets/homegenie/generic/images/icons/colorbulbs.png';
138138
}
139-
var srgbcolor = HG.WebApp.Utility.GetModulePropertyByName(module, "Status.ColorHsb");
139+
var srgbcolor = HG.WebApp.Utility.GetModulePropertyByName(module, "Status.ColorRgb");
140140
if (srgbcolor != null && this.ColorWheel != null) {
141141
var rgbcolor = 'rgb('+srgbcolor.Value+')';
142142
var color = Raphael.rgb2hsb(rgbcolor);

0 commit comments

Comments
 (0)