Skip to content

Commit

Permalink
various fixes and improvements to automation engine
Browse files Browse the repository at this point in the history
  • Loading branch information
genemars committed Sep 14, 2015
1 parent ab0f84f commit e34249b
Show file tree
Hide file tree
Showing 93 changed files with 545 additions and 389 deletions.
3 changes: 0 additions & 3 deletions BaseFiles/Common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,6 @@
<None Include="programs\82.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="programs\83.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="programs\84.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
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 @@ -198,9 +198,11 @@ HG.WebApp.Maintenance.InitializePage = function () {
$.mobile.loading('show', { text: 'Resetting to factory defaults, please wait...', textVisible: true, theme: 'a', html: '' });
// FACTORY RESET....
HG.Configure.System.ServiceCall("System.ConfigurationReset", function (data) {
alert('Factory Reset Completed!');
$.mobile.loading('hide');
setTimeout(function() { window.location.replace("/"); }, 3000);
setTimeout(function() {
$.mobile.loading('hide');
alert('Factory Reset Completed!');
window.location.replace("/");
}, 20000);
});
});
$('#systemsettings_backuprestores1selectallbtn').bind('click', function () {
Expand Down Expand Up @@ -245,8 +247,10 @@ HG.WebApp.Maintenance.InitializePage = function () {
$('#systemsettings_backuprestores1confirmbutton').addClass('ui-disabled');
$.mobile.loading('show', { text: 'Please be patient, this may take some time...', textVisible: true, theme: 'a', html: '' });
HG.Configure.System.ServiceCall("System.ConfigurationRestoreS2/" + HG.WebApp.Maintenance.RestoreProgramList, function (data) {
$.mobile.loading('hide');
setTimeout(function() { window.location.replace("/"); }, 3000);
setTimeout(function() {
window.location.replace("/");
$.mobile.loading('hide');
}, 20000);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ HG.WebApp.ProgramsList.RefreshProgramType = function () {
$('#configure_program_editorsketch').hide();
// switch specific language editors/labels/tools
if (HG.WebApp.ProgramEdit._CurrentProgram.Type.toLowerCase() != 'wizard') {
$('#program_edit_tab3_button').html(HG.WebApp.Locales.GetLocaleString('configure_program_setupcode', 'Setup Code'));
$('#program_edit_tab3_button').html(HG.WebApp.Locales.GetLocaleString('configure_program_startupcode', 'Startup Code'));
$('#automation_conditiontype').val('OnTrue'); // <--- this field is now only valid for wizard type programs
$('#automation_conditiontype_wrapper').hide();
if (HG.WebApp.ProgramEdit._CurrentProgram.Type.toLowerCase() == 'arduino') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</div>
<div class="ui-block-b">
<div data-role="controlgroup" data-type="horizontal">
<a data-ui-field="browse" data-locale-id="control_module_off" class="ui-btn ui-icon-bars ui-btn-icon-left" href="#">Browse</a>
<a data-ui-field="browse" data-locale-id="media_server_browse" class="ui-btn ui-icon-bars ui-btn-icon-left" href="#">Browse</a>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
//
this.GroupName = container.attr('data-context-group');
this.Description = module.Description;
this.DeviceInfo = HG.WebApp.Utility.GetModulePropertyByName(module, "UPnP.ModelDescription").Value;
var info = HG.WebApp.Utility.GetModulePropertyByName(module, "UPnP.ModelDescription");
this.DeviceInfo = (info != null) ? info.Value : "";
//
// render control popup
//
Expand Down
17 changes: 17 additions & 0 deletions BaseFiles/Common/html/pages/events/_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,23 @@ HG.WebApp.Events.RemoveListener = function (listener) {

HG.WebApp.Events.Setup = function () {
var es = new EventSource('/events');
es.onopen = function(e) {
HG.WebApp.Events.ShowEventPopup({
icon: 'images/genie.png',
title: 'HomeGenie<br/>Event Stream<br/>CONNECTED!',
text: '',
timestamp: ''
});
};
es.onerror = function(e) {
HG.WebApp.Events.ShowEventPopup({
icon: 'images/genie.png',
title: 'HomeGenie<br/>EventStream<br/>DISCONNECTED!',
text: '',
timestamp: ''
});
//setTimeout(HG.WebApp.Events.Setup, 5000);
};
es.onmessage = function (e) {
var event = JSON && JSON.parse(e.data) || $.parseJSON(e.data);
event.Value = event.Value.toString();
Expand Down

0 comments on commit e34249b

Please sign in to comment.