Skip to content

Commit 3970a20

Browse files
committed
- Fixed ZWave interface sensor timeout bug and sensor Status.Level "0.01" bug
- Disabled limit of max one opened http connection per program in NetHelper
1 parent 97255ce commit 3970a20

12 files changed

Lines changed: 58 additions & 31 deletions

File tree

BaseFiles/Common/Common.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4899,10 +4899,6 @@
48994899
<Link>lib\mig\LibUsbDotNet.dll</Link>
49004900
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
49014901
</None>
4902-
<None Include="..\..\Externals\g-labs\SerialPortLib.dll">
4903-
<Link>lib\shared\SerialPortLib.dll</Link>
4904-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4905-
</None>
49064902
<None Include="..\..\Externals\g-labs\W800Rf32Lib.dll">
49074903
<Link>lib\mig\W800Rf32Lib.dll</Link>
49084904
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
0 Bytes
Binary file not shown.

BaseFiles/Common/html/pages/configure/groups/_groupmodules.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,23 @@ HG.WebApp.GroupModules.GetModulesListViewItems = function (groupname) {
330330
var haselement = $.grep(groupmodules.Modules, function (value) {
331331
return (value.Domain == module.Domain && value.Address == module.Address);
332332
});
333+
// module it's not present in current group
333334
if (haselement.length == 0) {
334335
var propwidget = HG.WebApp.Utility.GetModulePropertyByName(module, "Widget.DisplayModule");
335336
var vmparentid = HG.WebApp.Utility.GetModulePropertyByName(module, "VirtualModule.ParentId");
336-
// check if no explicit witdget is specified and it's not a virtual module
337-
if ((propwidget != null && propwidget.Value != null && propwidget.Value == "") && (vmparentid != null && vmparentid.Value == module.Address)) continue;
337+
var widget = (propwidget != null && propwidget.Value != null) ? propwidget.Value : '';
338+
var vid = (vmparentid != null && vmparentid.Value != null) ? vmparentid.Value : '';
339+
// check if no explicit witdget is specified and it's not a virtual module or program
340+
if (module.Domain == 'HomeAutomation.HomeGenie.Automation') {
341+
var pid = (vid != '' && vid != module.Address) ? vid : module.Address;
342+
var cp = HG.WebApp.Utility.GetProgramByAddress(pid);
343+
if (cp != null) {
344+
if (!cp.IsEnabled)
345+
continue;
346+
else if (cp.Type.toLowerCase() != 'wizard' && widget == '')
347+
continue;
348+
}
349+
}
338350
//
339351
if (cursect != module.Domain) {
340352
cursect = module.Domain;

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,26 @@
3434
requestPopupOpen = false;
3535
var popup = $(cuid).find('[data-ui-field=widget]').data('ControlPopUp');
3636
popup.find('[data-ui-field=camerapicture]').attr('src', imageurl + '?' + (new Date().getTime()));
37-
$.mobile.loading('hide');
3837
});
39-
controlpopup.on('popupafterclose', function () { popupisopen = false; });
38+
controlpopup.on('popupafterclose', function () { popupisopen = false; $.mobile.loading('hide'); });
4039
controlpopup.find('[data-ui-field=camerapicture]').attr('src', imageurl + '?' + (new Date().getTime())).load(function () {
4140
var popup = $(cuid).find('[data-ui-field=widget]').data('ControlPopUp');
4241
if (requestPopupOpen) {
4342
popup.popup('open');
4443
} else if (popupisopen) {
44+
$.mobile.loading('hide');
4545
setTimeout(function () {
4646
popup.find('[data-ui-field=camerapicture]').attr('src', imageurl + '?' + (new Date().getTime()));
4747
}, 100);
4848
}
49+
}).error(function () {
50+
var popup = $(cuid).find('[data-ui-field=widget]').data('ControlPopUp');
51+
if (popupisopen) {
52+
$.mobile.loading('show', { text: 'Error connecting to camera', textVisible: true });
53+
setTimeout(function () {
54+
popup.find('[data-ui-field=camerapicture]').attr('src', imageurl + '?' + (new Date().getTime()));
55+
}, 2000);
56+
}
4957
});
5058
//
5159
// initialization stuff here
@@ -54,7 +62,7 @@
5462
widget.find('[data-ui-field=camerapicturepreview]').on('click', function () {
5563
if ($(cuid).find('[data-ui-field=widget]').data('ControlPopUp')) {
5664
var popup = $(cuid).find('[data-ui-field=widget]').data('ControlPopUp');
57-
$.mobile.loading('show');
65+
$.mobile.loading('show', { text: 'Connecting to camera', textVisible: true });
5866
requestPopupOpen = true;
5967
popup.find('[data-ui-field=camerapicture]').attr('src', imageurl + '?' + (new Date().getTime()));
6068
}
@@ -65,6 +73,12 @@
6573
_this.Widget.find('[data-ui-field=camerapicturepreview]').attr('src', imageurl + '?' + (new Date().getTime()));
6674
}, 2000);
6775
}
76+
}).error(function () {
77+
if (_this.Widget.is(':visible')) {
78+
setTimeout(function () {
79+
_this.Widget.find('[data-ui-field=camerapicturepreview]').attr('src', imageurl + '?' + (new Date().getTime()));
80+
}, 2000);
81+
}
6882
});
6983
//
7084
// ui events handlers
0 Bytes
Binary file not shown.
91 Bytes
Binary file not shown.

Externals/g-labs/MIG.dll

0 Bytes
Binary file not shown.

Externals/g-labs/MIG.dll.mdb

101 Bytes
Binary file not shown.

HISTORY.TXT

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
RELEASE HISTORY
22

3-
04/11/2015 v1.1-beta.500
4-
- Improved media server widget with thumbnails and multiple bitrates and formats support
5-
- Added UPnP interface command AvMedia.GetItem
3+
05/11/2015 v1.1-beta.500
4+
- Fixed ZWave interface sensor timeout bug and sensor Status.Level "0.01" bug
5+
- Disabled limit of max one opened http connection per program in NetHelper
6+
- Improved media server widget with thumbnails and support for multiple bitrates and formats
7+
- Added UPnP interface command "AvMedia.GetItem"
68
- Improved camera widget
79
- Fixed 'continuous Event Stream disconnection' bug when running on old mono ARM-hf (eg. Raspberry Pi)
810
- Updated Spanish locales

HomeGenie/Automation/Scripting/NetHelper.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public class NetHelper
7373

7474
// multithread safe lock objects
7575
private object smtpSyncLock = new object();
76-
private object httpSyncLock = new object();
76+
//private object httpSyncLock = new object();
7777
private object mqttSyncLock = new object();
7878

7979
private HomeGenieService homegenie;
@@ -396,7 +396,7 @@ public NetHelper AddHeader(string name, string value)
396396
public string Call()
397397
{
398398
string returnvalue = "";
399-
lock(httpSyncLock)
399+
//lock(httpSyncLock)
400400
using (var webClient = new WebClient())
401401
{
402402
try
@@ -483,7 +483,7 @@ public dynamic GetData()
483483
public byte[] GetBytes()
484484
{
485485
byte[] responseBytes = null;
486-
lock(httpSyncLock)
486+
//lock(httpSyncLock)
487487
using (var webClient = new WebClient())
488488
{
489489
try
@@ -664,13 +664,13 @@ private class WebClient : System.Net.WebClient
664664
protected override WebRequest GetWebRequest(Uri uri)
665665
{
666666
WebRequest w = base.GetWebRequest(uri);
667-
// Disable Keep-Alive
668-
if (w is HttpWebRequest)
669-
{
670-
(w as HttpWebRequest).KeepAlive = false;
671-
}
672-
// WebClient default timeout set to 30 seconds
673-
w.Timeout = 30 * 1000;
667+
// Disable Keep-Alive (this lead to poor performance, so let's keep it disabled by default)
668+
//if (w is HttpWebRequest)
669+
//{
670+
// (w as HttpWebRequest).KeepAlive = false;
671+
//}
672+
// WebClient default timeout set to 10 seconds
673+
w.Timeout = 10 * 1000;
674674
return w;
675675
}
676676
}

0 commit comments

Comments
 (0)