Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix to #79, #86 #87

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions nodes/heater/frontEndSlider.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.heater-slider.wrapper {
padding: 0.5em;
padding: 0.1em;
}

.heater-slider p.title {
Expand Down Expand Up @@ -36,7 +36,7 @@

.heater-slider .current-cal-temp {
color: #0094ce;
font-size: 1.5em;
font-size: large;
font-weight: bold;
}

Expand All @@ -56,11 +56,11 @@

.heater-slider .temp {
color: #0094ce;
font-size: 5em;
font-size: 4em;
font-weight: bold;
}

.heater-slider md-slider .md-track {
.heater-slider .md-slider .md-track {
background-color: gray;
}

Expand Down
1 change: 1 addition & 0 deletions nodes/heater/frontEndSlider.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<div>
<md-slider md-discrete ng-disabled='!status || !status.targetValue || !status.currentTemp' ng-change="userTargetChanged($event)" class="md-primary" ng-model="status.userTargetValue"
step="{{config.sliderStep}}" min="{{config.sliderMinValue}}" max="{{config.sliderMaxValue}}" title="Current user target temperature (userTargetValue)">
</md-slider>
</div>
</div>
</div>
Expand Down
15 changes: 7 additions & 8 deletions nodes/heater/heater.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ class Heater extends UINode {
this.status = {
'currentTemp': undefined, //Current room temperature
'targetValue': undefined, //Target temperature for the room
'isUserCustom': undefined, //Is targetValue a user custom value?
'isLocked': undefined, //Is targetValue locked (locker is true)
'isUserCustom': false, //Is targetValue a user custom value?
'isLocked': false, //Is targetValue locked (locker is true)
'userTargetValue': undefined, //Target temperature set by user
'currentSchedule': undefined, //Current target temperature from scheduler for this moment
'nextSchedule': undefined, //Next target temperature from scheduler for next change
'currentHeaterStatus': undefined, //Is heater running?
'currentHeaterStatus': "off", //Is heater running?
'time': new Date().toLocaleString()
}
this.context().set('status', this.status);
Expand Down Expand Up @@ -255,7 +255,7 @@ class Heater extends UINode {
var forced_ByScheduler = this.oldStatus.currentTemp === undefined;

//Schedule has been changed but the targetTemperature is locked, only currentTemp can change the status
//I know that I could merge those if's but I want to keep it very simple
//I know that I could merge those if's, but I want to keep it very simple
if (!forced_ByScheduler && this.status.isLocked) {
this.status.targetValue = this.status.userTargetValue;
return this.calculateStatus(this.status.targetValue);
Expand All @@ -270,14 +270,13 @@ class Heater extends UINode {
//Schedule has been changed
if (forced_ByScheduler || scheduleChanged) {
this.status.targetValue = this.status.currentSchedule.temp;
this.status.userTargetValue = this.status.currentSchedule.temp;
var heaterNewStatus = this.calculateStatus(this.status.targetValue);
if (heaterNewStatus !== this.oldStatus.currentHeaterStatus) {
this.status.isUserCustom = false;
}
this.status.isUserCustom = false;
return heaterNewStatus;
}

//if no other chases are reached the it will be user custom value else scenario should not exits
//if no other chases are reached then it will be user custom value else scenario should not exist
if (this.status.isUserCustom) {
this.status.targetValue = this.status.userTargetValue;
return this.calculateStatus(this.status.targetValue);
Expand Down