Skip to content

Commit 913bca3

Browse files
committed
v1.1-beta.501
- Added UPnP AvMedia.Seek command - Added configurable command delay and heal network options to ZWave interface - Fix blocking event propagation. Events are now processed asynchronously (also solves issue #237) - Fix Security Alarm program events propagation issue - Fixed Media Server browser widget not listing/linking files encoded in one format only; fixed also issues with XBMC and Kodi media player
1 parent c453c9a commit 913bca3

25 files changed

Lines changed: 203 additions & 189 deletions

File tree

-80 Bytes
Binary file not shown.

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

Lines changed: 53 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,37 @@
22

33
<div class="ui-grid-a">
44
<div class="ui-block-a">
5-
<span data-locale-id="device_port">Device Port</span>
6-
<div data-role="controlgroup" data-type="horizontal" data-mini="true">
7-
<select data-ui-field="serialport" data-mini="true"></select>
8-
</div>
9-
</div>
10-
<div class="ui-block-a">
11-
<span data-locale-id="command_delay">Command Delay</span>
12-
<div data-role="controlgroup" data-type="horizontal" data-mini="true">
13-
<select data-ui-field="commanddelay" data-mini="true"></select>
14-
</div>
15-
</div>
16-
<div class="ui-block-a">
17-
<span data-locale-id="startup_discovery">Discovery on Startup</span>
18-
<div data-role="controlgroup" data-type="horizontal" data-mini="true">
19-
<select data-ui-field="startupdiscovery" data-mini="true"></select>
5+
<div class="ui-grid-b">
6+
<div class="ui-block-a">
7+
<span data-locale-id="device_port">Device Port</span>
8+
<div data-role="controlgroup" data-type="horizontal" data-mini="true">
9+
<select data-ui-field="serialport" data-mini="true"></select>
10+
</div>
11+
</div>
12+
<div class="ui-block-b">
13+
<span data-locale-id="startup_discovery">Discovery on Startup</span>
14+
<div data-role="controlgroup" data-type="horizontal" data-mini="true">
15+
<select data-ui-field="startupdiscovery" data-mini="true">
16+
<option value="1">Yes</option>
17+
<option value="0">No</option>
18+
</select>
19+
</div>
20+
</div>
21+
<div class="ui-block-c">
22+
<span data-locale-id="command_delay">Command Delay</span>
23+
<div data-role="controlgroup" data-type="horizontal" data-mini="true">
24+
<select data-ui-field="commanddelay" data-mini="true">
25+
<option value="100">100ms</option>
26+
<option value="150">150ms</option>
27+
<option value="200">200ms</option>
28+
<option value="250">250ms</option>
29+
<option value="300">300ms</option>
30+
<option value="400">400ms</option>
31+
<option value="500">500ms</option>
32+
<option value="750">750ms</option>
33+
</select>
34+
</div>
35+
</div>
2036
</div>
2137
</div>
2238
<div class="ui-block-b" align="right">
@@ -33,9 +49,9 @@
3349
<span data-locale-id="common_tasks">ZWave Common Tasks</span>
3450
<div data-role="controlgroup" data-type="horizontal" data-mini="true">
3551
<a data-ui-field="discovery_btn" data-locale-id="discovery" class="ui-btn ui-icon-search ui-btn-icon-left">Discovery</a>
36-
<a data-ui-field="healnetwork_btn" data-locale-id="healnetwork" class="ui-btn ui-icon-search ui-btn-icon-left">Heal Network</a>
3752
<a data-ui-field="addnode_btn" data-locale-id="add_node" class="ui-btn ui-icon-plus ui-btn-icon-left">Add Node</a>
3853
<a data-ui-field="removenode_btn" data-locale-id="remove_node" class="ui-btn ui-icon-minus ui-btn-icon-left">Remove Node</a>
54+
<a data-ui-field="healnetwork_btn" data-locale-id="healnetwork" class="ui-btn ui-icon-heart ui-btn-icon-left">Heal Network</a>
3955
<a data-ui-field="hardreset_btn" data-locale-id="hard_reset_heading" class="ui-btn ui-icon-alert ui-btn-icon-left">Hard Reset</a>
4056
</div>
4157
</div>
@@ -48,7 +64,7 @@
4864
<h1 data-locale-id="discovery_heading">ZWave Discovery</h1>
4965
</div>
5066
<div class="ui-content ui-corner-bottom" style="height:280px;max-height:280px;overflow-y:scroll;overflow-x:hidden;">
51-
<p data-ui-field="discovery_log" data-role="listview" style="font-family:monospace; font-size:8pt;"></p>
67+
<p data-ui-field="discovery_log" style="font-family:monospace; font-size:8pt;"></p>
5268
</div>
5369
<div data-role="footer" data-tap-toggle="false" align="center">
5470
<a href="#page_configure_groups" class="ui-btn ui-corner-all ui-icon-gear ui-btn-icon-left" style="margin:8px">Configure Groups and Modules</a>
@@ -61,7 +77,7 @@ <h1 data-locale-id="discovery_heading">ZWave Discovery</h1>
6177
<h1 data-locale-id="healnetwork_heading">ZWave Network Heal</h1>
6278
</div>
6379
<div class="ui-content ui-corner-bottom" style="height:280px;max-height:280px;overflow-y:scroll;overflow-x:hidden;">
64-
<p data-ui-field="healnetwork_log" data-role="listview" style="font-family:monospace; font-size:8pt;"></p>
80+
<p data-ui-field="healnetwork_log" style="font-family:monospace; font-size:8pt;"></p>
6581
</div>
6682
</div>
6783

@@ -118,37 +134,33 @@ <h2 data-ui-field="nodeid" align="center"></h2>
118134
}
119135
});
120136
});
121-
// populate startup discovery list
122-
startupDiscoverySelect.empty();
123-
startupDiscoverySelect.append('<option value="1">Yes</option>');
124-
startupDiscoverySelect.append('<option value="0">No</option>');
125-
// set current configured startup discovery
137+
138+
startupDiscoverySelect.selectmenu().selectmenu('refresh', true);
139+
// get current configured startup discovery
126140
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Get', 'StartupDiscovery', '', function (startupDiscovery) {
127-
startupDiscoverySelect.val(startupDiscovery.ResponseValue);
128-
startupDiscoverySelect.selectmenu('refresh', true);
141+
if (startupDiscovery && startupDiscovery.ResponseValue != '') {
142+
startupDiscoverySelect.val(startupDiscovery.ResponseValue);
143+
startupDiscoverySelect.selectmenu('refresh', true);
144+
}
129145
});
130146
// bind to startup discovery change event
131147
startupDiscoverySelect.change(function (event) {
132148
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Set', 'StartupDiscovery', encodeURIComponent($(this).val()));
133149
});
134150

135-
// populate command delay list
136-
delaySelect.empty();
137-
delaySelect.append('<option value="0">0</option>');
138-
delaySelect.append('<option value="50">50</option>');
139-
delaySelect.append('<option value="100">100</option>');
140-
delaySelect.append('<option value="250">250</option>');
141-
delaySelect.append('<option value="500">500</option>');
142-
delaySelect.append('<option value="1000">1000</option>');
143-
// set current configured delay
151+
delaySelect.selectmenu().selectmenu('refresh', true);
152+
// get current configured delay
144153
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Get', 'Delay', '', function (delay) {
145-
delaySelect.val(delay.ResponseValue);
146-
delaySelect.selectmenu('refresh', true);
154+
if (delay && delay.ResponseValue != '') {
155+
delaySelect.val(delay.ResponseValue);
156+
delaySelect.selectmenu('refresh', true);
157+
}
147158
});
148-
// bind to port select change event
159+
// bind to command delay change event
149160
delaySelect.change(function (event) {
150161
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Set', 'Delay', encodeURIComponent($(this).val()));
151162
});
163+
152164
// populate serial port list
153165
HG.Configure.Interfaces.ServiceCall('Hardware.SerialPorts', function (ports) {
154166
portSelect.empty();
@@ -242,9 +254,9 @@ <h2 data-ui-field="nodeid" align="center"></h2>
242254
zwave_NodeAdd(function (res) {
243255
var nodeid = _this.NodeOperationPopup.find('[data-ui-field=nodeid]');
244256
var message = _this.NodeOperationPopup.find('[data-ui-field=message]');
245-
if (res != 0) {
257+
if (res.ResponseValue != 0) {
246258
HG.WebApp.Control.UpdateModules();
247-
nodeid.html(res);
259+
nodeid.html(res.ResponseValue);
248260
message.html('node added.');
249261
}
250262
else {
@@ -263,9 +275,9 @@ <h2 data-ui-field="nodeid" align="center"></h2>
263275
zwave_NodeRemove(function (res) {
264276
var nodeid = _this.NodeOperationPopup.find('[data-ui-field=nodeid]');
265277
var message = _this.NodeOperationPopup.find('[data-ui-field=message]');
266-
if (res != 0) {
278+
if (res.ResponseValue != 0) {
267279
HG.WebApp.Control.UpdateModules();
268-
nodeid.html(res);
280+
nodeid.html(res.ResponseValue);
269281
message.html('node removed.');
270282
}
271283
else {

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

Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,19 @@ HG.WebApp.Maintenance.InitializePage = function () {
9090
html: ""
9191
});
9292
HG.System.UpdateManager.InstallUpdate(function (res) {
93-
var r = eval(res);
94-
if (typeof r != 'undefined') {
95-
// TODO: ....
96-
if (r[0].ResponseValue == 'OK') {
97-
$('#configure_system_updateinstall_status').html('Update install complete.');
98-
setTimeout(function() { window.location.replace("/"); }, 3000);
99-
}
100-
else if (r[0].ResponseValue == 'RESTART') {
101-
$('#configure_system_updateinstall_status').html('Installing files... (HomeGenie service stopped)');
102-
}
103-
else if (r[0].ResponseValue == 'ERROR') {
104-
$('#configure_system_updateinstall_status').html('Error during installation progress.');
105-
//
106-
$.mobile.loading('hide');
107-
HG.WebApp.Maintenance.LoadUpdateCheckSettings();
108-
}
93+
// TODO: ....
94+
if (res.ResponseValue == 'OK') {
95+
$('#configure_system_updateinstall_status').html('Update install complete.');
96+
setTimeout(function() { window.location.replace("/"); }, 3000);
97+
}
98+
else if (res.ResponseValue == 'RESTART') {
99+
$('#configure_system_updateinstall_status').html('Installing files... (HomeGenie service stopped)');
100+
}
101+
else if (res.ResponseValue == 'ERROR') {
102+
$('#configure_system_updateinstall_status').html('Error during installation progress.');
103+
//
104+
$.mobile.loading('hide');
105+
HG.WebApp.Maintenance.LoadUpdateCheckSettings();
109106
}
110107
});
111108
});
@@ -127,22 +124,18 @@ HG.WebApp.Maintenance.InitializePage = function () {
127124
HG.System.UpdateManager.DownloadUpdate(function (res) {
128125
$.mobile.loading('hide');
129126
HG.WebApp.Maintenance.LoadUpdateCheckSettings();
130-
//
131-
var r = eval(res);
132-
if (typeof r != 'undefined') {
133-
// TODO: ....
134-
if (r[0].ResponseValue == 'OK') {
135-
$('#configure_system_updateinstall_status').html('Update files ready.');
136-
$('#configure_system_updateinstall_button').removeClass('ui-disabled');
137-
}
138-
else if (r[0].ResponseValue == 'RESTART') {
139-
$('#configure_system_updateinstall_status').html('Update files ready. HomeGenie will be restarted after updating.');
140-
$('#configure_system_updateinstall_button').removeClass('ui-disabled');
141-
}
142-
else if (r[0].ResponseValue == 'ERROR') {
143-
$('#configure_system_updateinstall_status').html('Error while downloading update files.');
144-
$('#configure_system_updateinstall_button').addClass('ui-disabled');
145-
}
127+
// TODO: ....
128+
if (res.ResponseValue == 'OK') {
129+
$('#configure_system_updateinstall_status').html('Update files ready.');
130+
$('#configure_system_updateinstall_button').removeClass('ui-disabled');
131+
}
132+
else if (res.ResponseValue == 'RESTART') {
133+
$('#configure_system_updateinstall_status').html('Update files ready. HomeGenie will be restarted after updating.');
134+
$('#configure_system_updateinstall_button').removeClass('ui-disabled');
135+
}
136+
else if (res.ResponseValue == 'ERROR') {
137+
$('#configure_system_updateinstall_status').html('Error while downloading update files.');
138+
$('#configure_system_updateinstall_button').addClass('ui-disabled');
146139
}
147140
});
148141
});
@@ -361,8 +354,7 @@ HG.WebApp.Maintenance.LoadSettings = function () {
361354
HG.WebApp.Maintenance.LoadUpdateCheckSettings = function () {
362355
$.mobile.loading('show');
363356
$('#configure_system_updateinstall_button').addClass('ui-disabled');
364-
HG.System.UpdateManager.GetUpdateList(function (data) {
365-
var releasedata = eval(data);
357+
HG.System.UpdateManager.GetUpdateList(function (releasedata) {
366358
if (releasedata.length == 0) {
367359
$('#configure_system_updatemanager_info').html('No updates available.');
368360
$('#configure_system_updatemanager_detailsscroll').hide();

BaseFiles/Common/html/pages/control/widgets/homegenie/generic/mediareceiver.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -95,28 +95,28 @@
9595
if (_this.PendingRequests == 0 && !_this.IsMouseDown) {
9696
var servicecall = HG.Control.Modules.ServiceCall;
9797
_this.PendingRequests++;
98-
servicecall('AvMedia.GetTransportInfo', module.Domain, module.Address, '', function (res) {
99-
var trinfo = eval(res)[0];
100-
var state = trinfo.CurrentTransportState;
101-
if (_this.Widget != null) {
102-
var playbutton = _this.Widget.find('[data-ui-field=media_play]');
103-
var pausebutton = _this.Widget.find('[data-ui-field=media_pause]');
104-
if (state == 'PAUSED_PLAYBACK') {
105-
playbutton.show();
106-
pausebutton.hide();
107-
}
108-
else if (state == 'STOPPED') {
109-
playbutton.show();
110-
pausebutton.hide();
111-
_this.Widget.find('[data-ui-field=media_position]').html('');
112-
}
113-
else if (state == 'PLAYING') {
114-
playbutton.hide();
115-
pausebutton.show();
116-
servicecall('AvMedia.GetPositionInfo', module.Domain, module.Address, '', function (res) {
117-
var posinfo = eval(res)[0];
118-
_this.Widget.find('[data-ui-field=media_position]').html(posinfo.RelTime);
119-
});
98+
servicecall('AvMedia.GetTransportInfo', module.Domain, module.Address, '', function (trinfo) {
99+
if (typeof trinfo != 'undefined') {
100+
var state = trinfo.CurrentTransportState;
101+
if (_this.Widget != null) {
102+
var playbutton = _this.Widget.find('[data-ui-field=media_play]');
103+
var pausebutton = _this.Widget.find('[data-ui-field=media_pause]');
104+
if (state == 'PAUSED_PLAYBACK') {
105+
playbutton.show();
106+
pausebutton.hide();
107+
}
108+
else if (state == 'STOPPED') {
109+
playbutton.show();
110+
pausebutton.hide();
111+
_this.Widget.find('[data-ui-field=media_position]').html('');
112+
}
113+
else if (state == 'PLAYING') {
114+
playbutton.hide();
115+
pausebutton.show();
116+
servicecall('AvMedia.GetPositionInfo', module.Domain, module.Address, '', function (posinfo) {
117+
_this.Widget.find('[data-ui-field=media_position]').html(posinfo.RelTime);
118+
});
119+
}
120120
}
121121
}
122122
_this.PendingRequests--;
@@ -125,7 +125,7 @@
125125
_this.PendingRequests++;
126126
servicecall('AvMedia.GetVolume', module.Domain, module.Address, '', function (res) {
127127
if (_this.Widget != null) {
128-
_this.Widget.find('[data-ui-field=media_volume]').val(res);
128+
_this.Widget.find('[data-ui-field=media_volume]').val(res.ResponseValue);
129129
_this.Widget.find('.ui-slider').width(250);
130130
_this.Widget.find('[data-ui-field=media_volume]').slider('refresh');
131131
}
@@ -134,7 +134,7 @@
134134
// get mute status
135135
_this.PendingRequests++;
136136
servicecall('AvMedia.GetMute', module.Domain, module.Address, '', function (res) {
137-
if (res == '0' || res.toLowerCase() == 'false') {
137+
if (res.ResponseValue.toLowerCase() == 'false') {
138138
_this.Widget.find('[data-ui-field=media_mute]').attr('src', 'pages/control/widgets/homegenie/generic/images/media_mute.png');
139139
_this.IsMuted = false;
140140
}

0 commit comments

Comments
 (0)