Skip to content

Commit

Permalink
- Fixed bug in Timetable when crossing from one table type to another…
Browse files Browse the repository at this point in the history
… on midnight (eg. from Weekday to Weekend)

- Added user-definable thermostat parameter to Eden Oled Menu widget
- Improved Basic Thermostat app, now compatible with Timetable scheduler and using Virtual Modules
- Added 0.5 step value input to the thermostat widget dial knob (issue genielabs#93)
(sf.net r478)
  • Loading branch information
genemars committed Feb 8, 2015
1 parent f54c63a commit 10f06d7
Show file tree
Hide file tree
Showing 18 changed files with 407 additions and 399 deletions.
Binary file modified BaseFiles/Common/homegenie_factory_config.zip
Binary file not shown.
26 changes: 18 additions & 8 deletions BaseFiles/Common/html/js/jquery.knob.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
};

this._validate = function(v) {
return (~~ (((v < 0) ? -0.5 : 0.5) + (v/this.o.step))) * this.o.step;
return Math.round(Math.floor(((v < 0) ? -0.5 : 0.5) + (v/this.o.step)) * this.o.step * 100 ) / 100;
};

// Abstract methods
Expand Down Expand Up @@ -453,8 +453,13 @@
a += this.PI2;
}

ret = ~~ (0.5 + (a * (this.o.max - this.o.min) / this.angleArc))
+ this.o.min;
ret = (a * (this.o.max - this.o.min) / this.angleArc) + this.o.min;

if(this.o.step > 1 && Math.round(this.o.step) == this.o.step) {
ret = ~~ (0.5 + ret);
} else {
ret = Math.floor(ret * 100) / 100;
}

this.o.stopper
&& (ret = max(min(ret, this.o.max), this.o.min));
Expand All @@ -470,14 +475,14 @@
var ori = e.originalEvent
,deltaX = ori.detail || ori.wheelDeltaX
,deltaY = ori.detail || ori.wheelDeltaY
,v = parseInt(s.$.val()) + (deltaX>0 || deltaY>0 ? s.o.step : deltaX<0 || deltaY<0 ? -s.o.step : 0);
,v = (Math.round(parseFloat(s.$.val()) * 100) / 100) + (deltaX>0 || deltaY>0 ? s.o.step : deltaX<0 || deltaY<0 ? -s.o.step : 0);

if (
s.cH
&& (s.cH(v) === false)
) return;

s.val(v);
s.val(s._validate(v));
}
, kval, to, m = 1, kv = {37:-s.o.step, 38:s.o.step, 39:s.o.step, 40:-s.o.step};

Expand Down Expand Up @@ -506,12 +511,17 @@
if ($.inArray(kc,[37,38,39,40]) > -1) {
e.preventDefault();

var v = parseInt(s.$.val()) + kv[kc] * m;

var v;
if(s.o.step > 1 && Math.round(s.o.step) == s.o.step) {
v = parseInt(s.$.val()) + kv[kc] * m;
} else {
v = parseFloat(s.$.val()) + kv[kc] * m;
}

s.o.stopper
&& (v = max(min(v, s.o.max), s.o.min));

s.change(v);
s.change(s._validate(v));
s._draw();

// long time keydown speed-up
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ <h4 data-ui-field="name" style="margin:0;margin-left:10px;">Description</h4>
data-height="120"
data-min="40"
data-max="100"
data-step="0.5"
data-gradient="bluered"
data-fgcolor="#CCCCCC"
data-bgcolor="#555555"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

controlpopup.find('[data-ui-field=level_knob]').knob({
'release': function (v) {
v = Math.round(v);
v = Math.round(v * 10) / 10;
var setPoint = HG.WebApp.Utility.GetModulePropertyByName(module, 'Thermostat.SetPoint.' + _this.levelKnobBindValue);
if (setPoint != null) setPoint.Value = v;
HG.Control.Modules.ServiceCall('Thermostat.SetPointSet/' + _this.levelKnobBindValue, module.Domain, module.Address, v, function (data) { });
Expand All @@ -47,13 +47,15 @@
if (displayUnit == 'Celsius') {
controlpopup.find('[data-ui-field=level_knob]').trigger('configure', {
min: 5,
max: 35
max: 35,
step: 0.5
});
}
else {
controlpopup.find('[data-ui-field=level_knob]').trigger('configure', {
min: 40,
max: 100
max: 100,
step: 1
});
}

Expand All @@ -72,24 +74,29 @@
// popup values on open
controlpopup.on('popupbeforeposition', function (evt, ui) {
// reset buttons' state
controlpopup.find('[data-ui-field=mode_off]').removeClass('ui-btn-active');
controlpopup.find('[data-ui-field=mode_off]').addClass('ui-btn-active');
controlpopup.find('[data-ui-field=mode_cool]').removeClass('ui-btn-active');
controlpopup.find('[data-ui-field=mode_heat]').removeClass('ui-btn-active');
if (_this.levelKnobBindValue == 'Heating')
{
_this.EditHeatSetPoint(controlpopup, module);
}
else
{
_this.EditCoolSetPoint(controlpopup, module);
}
// set current buttons' state from module properties
var thermostatMode = HG.WebApp.Utility.GetModulePropertyByName(module, 'Thermostat.Mode');
if (thermostatMode != null) {
if (thermostatMode.Value == 'Cool') {
controlpopup.find('[data-ui-field=mode_off]').removeClass('ui-btn-active');
controlpopup.find('[data-ui-field=mode_cool]').addClass('ui-btn-active');
_this.EditCoolSetPoint(controlpopup, module);
}
else if (thermostatMode.Value == 'Heat') {
controlpopup.find('[data-ui-field=mode_off]').removeClass('ui-btn-active');
controlpopup.find('[data-ui-field=mode_heat]').addClass('ui-btn-active');
_this.EditHeatSetPoint(controlpopup, module);
}
}
else {
controlpopup.find('[data-ui-field=mode_off]').addClass('ui-btn-active');
}
//
});
// set point buttons events
Expand Down
10 changes: 5 additions & 5 deletions BaseFiles/Common/html/pages/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ <h1 data-locale-id="homegenie_about_title">About</h1>
<h5 style="font-family:georgia">HomeGenie</h5>
<fieldset data-role="fieldcontain" style="border:solid 1px gray;margin:10px;padding:10px;font-family:monospace;font-size:9pt;">
<div class="ui-grid-a">
<div data-locale-id="home_about_version" class="ui-block-a" style="width:27%">version</div>
<div class="ui-block-b" style="width:73%">&nbsp;&nbsp;1.00 beta r477</div>
<div data-locale-id="home_about_version" class="ui-block-a" style="width:27%">version&nbsp;&nbsp;</div>
<div class="ui-block-b" style="width:73%">&nbsp;&nbsp;1.00 beta r478</div>
</div>
<div class="ui-grid-a">
<div data-locale-id="home_about_codename" class="ui-block-a" style="width:27%">codename</div>
<div data-locale-id="home_about_codename" class="ui-block-a" style="width:27%">codename&nbsp;&nbsp;</div>
<div class="ui-block-b" style="width:73%">&nbsp;&nbsp;AutomaThing</div>
</div>
<div class="ui-grid-a">
<div data-locale-id="home_about_motto" class="ui-block-a" style="width:27%">motto</div>
<div data-locale-id="home_about_motto" class="ui-block-a" style="width:27%">motto&nbsp;&nbsp;</div>
<div class="ui-block-b" style="width:73%">&nbsp;&nbsp;Things Different! =P</div>
</div>
<div class="ui-grid-a">
<div data-locale-id="home_about_license" class="ui-block-a" style="width:27%">license</div>
<div data-locale-id="home_about_license" class="ui-block-a" style="width:27%">license&nbsp;&nbsp;</div>
<div class="ui-block-b" style="width:73%">&nbsp;&nbsp;<a href="http://creativecommons.org/licenses/by-nc/3.0/" target="_blank">CC BY-NC 3.0</a></div>
</div>
</fieldset>
Expand Down
64 changes: 0 additions & 64 deletions BaseFiles/Common/modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1016,70 +1016,6 @@
</Properties>
<RoutingNode />
</Module>
<Module>
<Name>Generic Thermostat</Name>
<Description />
<DeviceType>Program</DeviceType>
<Domain>HomeAutomation.HomeGenie.Automation</Domain>
<Address>78</Address>
<Properties>
<ModuleParameter>
<Name>ConfigureOptions.SwitchModule</Name>
<Value />
<Description>Module to switch on/off on set point</Description>
<UpdateTime>2014-11-13T09:13:29.454845Z</UpdateTime>
</ModuleParameter>
<ModuleParameter>
<Name>ConfigureOptions.TemperatureModule</Name>
<Value />
<Description>Module to read temperature from</Description>
<UpdateTime>2014-11-13T09:13:29.45484Z</UpdateTime>
</ModuleParameter>
<ModuleParameter>
<Name>Program.Status</Name>
<Value>NGAg5Bttn96/TAPvzSiLvQ==</Value>
<Description />
<UpdateTime>2015-01-03T14:02:11.103577Z</UpdateTime>
</ModuleParameter>
<ModuleParameter>
<Name>Sensor.Temperature</Name>
<Value />
<Description />
<UpdateTime>2014-11-13T09:13:29.457119Z</UpdateTime>
</ModuleParameter>
<ModuleParameter>
<Name>Thermostat.Mode</Name>
<Value />
<Description />
<UpdateTime>2014-11-13T09:13:29.457128Z</UpdateTime>
</ModuleParameter>
<ModuleParameter>
<Name>Thermostat.OperatingState</Name>
<Value />
<Description />
<UpdateTime>2014-11-13T09:13:29.457124Z</UpdateTime>
</ModuleParameter>
<ModuleParameter>
<Name>Thermostat.SetPoint.Heating</Name>
<Value />
<Description />
<UpdateTime>2014-11-13T09:13:29.457132Z</UpdateTime>
</ModuleParameter>
<ModuleParameter>
<Name>VirtualModule.ParentId</Name>
<Value>78</Value>
<Description />
<UpdateTime>2014-11-13T09:13:29.45573Z</UpdateTime>
</ModuleParameter>
<ModuleParameter>
<Name>Widget.DisplayModule</Name>
<Value>homegenie/generic/thermostat</Value>
<Description />
<UpdateTime>2014-11-13T09:13:29.446435Z</UpdateTime>
</ModuleParameter>
</Properties>
<RoutingNode />
</Module>
<Module>
<Name>Energy Monitor</Name>
<Description />
Expand Down
Loading

0 comments on commit 10f06d7

Please sign in to comment.