Skip to content

Commit

Permalink
v1.1-beta.501
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
genemars committed Nov 18, 2015
1 parent c453c9a commit 913bca3
Show file tree
Hide file tree
Showing 25 changed files with 203 additions and 189 deletions.
Binary file modified BaseFiles/Common/homegenie_factory_config.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,37 @@

<div class="ui-grid-a">
<div class="ui-block-a">
<span data-locale-id="device_port">Device Port</span>
<div data-role="controlgroup" data-type="horizontal" data-mini="true">
<select data-ui-field="serialport" data-mini="true"></select>
</div>
</div>
<div class="ui-block-a">
<span data-locale-id="command_delay">Command Delay</span>
<div data-role="controlgroup" data-type="horizontal" data-mini="true">
<select data-ui-field="commanddelay" data-mini="true"></select>
</div>
</div>
<div class="ui-block-a">
<span data-locale-id="startup_discovery">Discovery on Startup</span>
<div data-role="controlgroup" data-type="horizontal" data-mini="true">
<select data-ui-field="startupdiscovery" data-mini="true"></select>
<div class="ui-grid-b">
<div class="ui-block-a">
<span data-locale-id="device_port">Device Port</span>
<div data-role="controlgroup" data-type="horizontal" data-mini="true">
<select data-ui-field="serialport" data-mini="true"></select>
</div>
</div>
<div class="ui-block-b">
<span data-locale-id="startup_discovery">Discovery on Startup</span>
<div data-role="controlgroup" data-type="horizontal" data-mini="true">
<select data-ui-field="startupdiscovery" data-mini="true">
<option value="1">Yes</option>
<option value="0">No</option>
</select>
</div>
</div>
<div class="ui-block-c">
<span data-locale-id="command_delay">Command Delay</span>
<div data-role="controlgroup" data-type="horizontal" data-mini="true">
<select data-ui-field="commanddelay" data-mini="true">
<option value="100">100ms</option>
<option value="150">150ms</option>
<option value="200">200ms</option>
<option value="250">250ms</option>
<option value="300">300ms</option>
<option value="400">400ms</option>
<option value="500">500ms</option>
<option value="750">750ms</option>
</select>
</div>
</div>
</div>
</div>
<div class="ui-block-b" align="right">
Expand All @@ -33,9 +49,9 @@
<span data-locale-id="common_tasks">ZWave Common Tasks</span>
<div data-role="controlgroup" data-type="horizontal" data-mini="true">
<a data-ui-field="discovery_btn" data-locale-id="discovery" class="ui-btn ui-icon-search ui-btn-icon-left">Discovery</a>
<a data-ui-field="healnetwork_btn" data-locale-id="healnetwork" class="ui-btn ui-icon-search ui-btn-icon-left">Heal Network</a>
<a data-ui-field="addnode_btn" data-locale-id="add_node" class="ui-btn ui-icon-plus ui-btn-icon-left">Add Node</a>
<a data-ui-field="removenode_btn" data-locale-id="remove_node" class="ui-btn ui-icon-minus ui-btn-icon-left">Remove Node</a>
<a data-ui-field="healnetwork_btn" data-locale-id="healnetwork" class="ui-btn ui-icon-heart ui-btn-icon-left">Heal Network</a>
<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>
</div>
</div>
Expand All @@ -48,7 +64,7 @@
<h1 data-locale-id="discovery_heading">ZWave Discovery</h1>
</div>
<div class="ui-content ui-corner-bottom" style="height:280px;max-height:280px;overflow-y:scroll;overflow-x:hidden;">
<p data-ui-field="discovery_log" data-role="listview" style="font-family:monospace; font-size:8pt;"></p>
<p data-ui-field="discovery_log" style="font-family:monospace; font-size:8pt;"></p>
</div>
<div data-role="footer" data-tap-toggle="false" align="center">
<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>
Expand All @@ -61,7 +77,7 @@ <h1 data-locale-id="discovery_heading">ZWave Discovery</h1>
<h1 data-locale-id="healnetwork_heading">ZWave Network Heal</h1>
</div>
<div class="ui-content ui-corner-bottom" style="height:280px;max-height:280px;overflow-y:scroll;overflow-x:hidden;">
<p data-ui-field="healnetwork_log" data-role="listview" style="font-family:monospace; font-size:8pt;"></p>
<p data-ui-field="healnetwork_log" style="font-family:monospace; font-size:8pt;"></p>
</div>
</div>

Expand Down Expand Up @@ -118,37 +134,33 @@ <h2 data-ui-field="nodeid" align="center"></h2>
}
});
});
// populate startup discovery list
startupDiscoverySelect.empty();
startupDiscoverySelect.append('<option value="1">Yes</option>');
startupDiscoverySelect.append('<option value="0">No</option>');
// set current configured startup discovery

startupDiscoverySelect.selectmenu().selectmenu('refresh', true);
// get current configured startup discovery
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Get', 'StartupDiscovery', '', function (startupDiscovery) {
startupDiscoverySelect.val(startupDiscovery.ResponseValue);
startupDiscoverySelect.selectmenu('refresh', true);
if (startupDiscovery && startupDiscovery.ResponseValue != '') {
startupDiscoverySelect.val(startupDiscovery.ResponseValue);
startupDiscoverySelect.selectmenu('refresh', true);
}
});
// bind to startup discovery change event
startupDiscoverySelect.change(function (event) {
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Set', 'StartupDiscovery', encodeURIComponent($(this).val()));
});

// populate command delay list
delaySelect.empty();
delaySelect.append('<option value="0">0</option>');
delaySelect.append('<option value="50">50</option>');
delaySelect.append('<option value="100">100</option>');
delaySelect.append('<option value="250">250</option>');
delaySelect.append('<option value="500">500</option>');
delaySelect.append('<option value="1000">1000</option>');
// set current configured delay
delaySelect.selectmenu().selectmenu('refresh', true);
// get current configured delay
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Get', 'Delay', '', function (delay) {
delaySelect.val(delay.ResponseValue);
delaySelect.selectmenu('refresh', true);
if (delay && delay.ResponseValue != '') {
delaySelect.val(delay.ResponseValue);
delaySelect.selectmenu('refresh', true);
}
});
// bind to port select change event
// bind to command delay change event
delaySelect.change(function (event) {
HG.Configure.MIG.InterfaceCommand(_this.Id, 'Options.Set', 'Delay', encodeURIComponent($(this).val()));
});

// populate serial port list
HG.Configure.Interfaces.ServiceCall('Hardware.SerialPorts', function (ports) {
portSelect.empty();
Expand Down Expand Up @@ -242,9 +254,9 @@ <h2 data-ui-field="nodeid" align="center"></h2>
zwave_NodeAdd(function (res) {
var nodeid = _this.NodeOperationPopup.find('[data-ui-field=nodeid]');
var message = _this.NodeOperationPopup.find('[data-ui-field=message]');
if (res != 0) {
if (res.ResponseValue != 0) {
HG.WebApp.Control.UpdateModules();
nodeid.html(res);
nodeid.html(res.ResponseValue);
message.html('node added.');
}
else {
Expand All @@ -263,9 +275,9 @@ <h2 data-ui-field="nodeid" align="center"></h2>
zwave_NodeRemove(function (res) {
var nodeid = _this.NodeOperationPopup.find('[data-ui-field=nodeid]');
var message = _this.NodeOperationPopup.find('[data-ui-field=message]');
if (res != 0) {
if (res.ResponseValue != 0) {
HG.WebApp.Control.UpdateModules();
nodeid.html(res);
nodeid.html(res.ResponseValue);
message.html('node removed.');
}
else {
Expand Down
60 changes: 26 additions & 34 deletions BaseFiles/Common/html/pages/configure/maintenance/_maintenance.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,19 @@ HG.WebApp.Maintenance.InitializePage = function () {
html: ""
});
HG.System.UpdateManager.InstallUpdate(function (res) {
var r = eval(res);
if (typeof r != 'undefined') {
// TODO: ....
if (r[0].ResponseValue == 'OK') {
$('#configure_system_updateinstall_status').html('Update install complete.');
setTimeout(function() { window.location.replace("/"); }, 3000);
}
else if (r[0].ResponseValue == 'RESTART') {
$('#configure_system_updateinstall_status').html('Installing files... (HomeGenie service stopped)');
}
else if (r[0].ResponseValue == 'ERROR') {
$('#configure_system_updateinstall_status').html('Error during installation progress.');
//
$.mobile.loading('hide');
HG.WebApp.Maintenance.LoadUpdateCheckSettings();
}
// TODO: ....
if (res.ResponseValue == 'OK') {
$('#configure_system_updateinstall_status').html('Update install complete.');
setTimeout(function() { window.location.replace("/"); }, 3000);
}
else if (res.ResponseValue == 'RESTART') {
$('#configure_system_updateinstall_status').html('Installing files... (HomeGenie service stopped)');
}
else if (res.ResponseValue == 'ERROR') {
$('#configure_system_updateinstall_status').html('Error during installation progress.');
//
$.mobile.loading('hide');
HG.WebApp.Maintenance.LoadUpdateCheckSettings();
}
});
});
Expand All @@ -127,22 +124,18 @@ HG.WebApp.Maintenance.InitializePage = function () {
HG.System.UpdateManager.DownloadUpdate(function (res) {
$.mobile.loading('hide');
HG.WebApp.Maintenance.LoadUpdateCheckSettings();
//
var r = eval(res);
if (typeof r != 'undefined') {
// TODO: ....
if (r[0].ResponseValue == 'OK') {
$('#configure_system_updateinstall_status').html('Update files ready.');
$('#configure_system_updateinstall_button').removeClass('ui-disabled');
}
else if (r[0].ResponseValue == 'RESTART') {
$('#configure_system_updateinstall_status').html('Update files ready. HomeGenie will be restarted after updating.');
$('#configure_system_updateinstall_button').removeClass('ui-disabled');
}
else if (r[0].ResponseValue == 'ERROR') {
$('#configure_system_updateinstall_status').html('Error while downloading update files.');
$('#configure_system_updateinstall_button').addClass('ui-disabled');
}
// TODO: ....
if (res.ResponseValue == 'OK') {
$('#configure_system_updateinstall_status').html('Update files ready.');
$('#configure_system_updateinstall_button').removeClass('ui-disabled');
}
else if (res.ResponseValue == 'RESTART') {
$('#configure_system_updateinstall_status').html('Update files ready. HomeGenie will be restarted after updating.');
$('#configure_system_updateinstall_button').removeClass('ui-disabled');
}
else if (res.ResponseValue == 'ERROR') {
$('#configure_system_updateinstall_status').html('Error while downloading update files.');
$('#configure_system_updateinstall_button').addClass('ui-disabled');
}
});
});
Expand Down Expand Up @@ -361,8 +354,7 @@ HG.WebApp.Maintenance.LoadSettings = function () {
HG.WebApp.Maintenance.LoadUpdateCheckSettings = function () {
$.mobile.loading('show');
$('#configure_system_updateinstall_button').addClass('ui-disabled');
HG.System.UpdateManager.GetUpdateList(function (data) {
var releasedata = eval(data);
HG.System.UpdateManager.GetUpdateList(function (releasedata) {
if (releasedata.length == 0) {
$('#configure_system_updatemanager_info').html('No updates available.');
$('#configure_system_updatemanager_detailsscroll').hide();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,28 +95,28 @@
if (_this.PendingRequests == 0 && !_this.IsMouseDown) {
var servicecall = HG.Control.Modules.ServiceCall;
_this.PendingRequests++;
servicecall('AvMedia.GetTransportInfo', module.Domain, module.Address, '', function (res) {
var trinfo = eval(res)[0];
var state = trinfo.CurrentTransportState;
if (_this.Widget != null) {
var playbutton = _this.Widget.find('[data-ui-field=media_play]');
var pausebutton = _this.Widget.find('[data-ui-field=media_pause]');
if (state == 'PAUSED_PLAYBACK') {
playbutton.show();
pausebutton.hide();
}
else if (state == 'STOPPED') {
playbutton.show();
pausebutton.hide();
_this.Widget.find('[data-ui-field=media_position]').html('');
}
else if (state == 'PLAYING') {
playbutton.hide();
pausebutton.show();
servicecall('AvMedia.GetPositionInfo', module.Domain, module.Address, '', function (res) {
var posinfo = eval(res)[0];
_this.Widget.find('[data-ui-field=media_position]').html(posinfo.RelTime);
});
servicecall('AvMedia.GetTransportInfo', module.Domain, module.Address, '', function (trinfo) {
if (typeof trinfo != 'undefined') {
var state = trinfo.CurrentTransportState;
if (_this.Widget != null) {
var playbutton = _this.Widget.find('[data-ui-field=media_play]');
var pausebutton = _this.Widget.find('[data-ui-field=media_pause]');
if (state == 'PAUSED_PLAYBACK') {
playbutton.show();
pausebutton.hide();
}
else if (state == 'STOPPED') {
playbutton.show();
pausebutton.hide();
_this.Widget.find('[data-ui-field=media_position]').html('');
}
else if (state == 'PLAYING') {
playbutton.hide();
pausebutton.show();
servicecall('AvMedia.GetPositionInfo', module.Domain, module.Address, '', function (posinfo) {
_this.Widget.find('[data-ui-field=media_position]').html(posinfo.RelTime);
});
}
}
}
_this.PendingRequests--;
Expand All @@ -125,7 +125,7 @@
_this.PendingRequests++;
servicecall('AvMedia.GetVolume', module.Domain, module.Address, '', function (res) {
if (_this.Widget != null) {
_this.Widget.find('[data-ui-field=media_volume]').val(res);
_this.Widget.find('[data-ui-field=media_volume]').val(res.ResponseValue);
_this.Widget.find('.ui-slider').width(250);
_this.Widget.find('[data-ui-field=media_volume]').slider('refresh');
}
Expand All @@ -134,7 +134,7 @@
// get mute status
_this.PendingRequests++;
servicecall('AvMedia.GetMute', module.Domain, module.Address, '', function (res) {
if (res == '0' || res.toLowerCase() == 'false') {
if (res.ResponseValue.toLowerCase() == 'false') {
_this.Widget.find('[data-ui-field=media_mute]').attr('src', 'pages/control/widgets/homegenie/generic/images/media_mute.png');
_this.IsMuted = false;
}
Expand Down
Loading

0 comments on commit 913bca3

Please sign in to comment.