Skip to content

Commit

Permalink
Thermostat F scale handled
Browse files Browse the repository at this point in the history
  • Loading branch information
Poltorak Serguei committed Sep 13, 2015
1 parent 2ff3781 commit c0f0447
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 15 deletions.
2 changes: 1 addition & 1 deletion modules/EnOcean/index.js
Expand Up @@ -537,7 +537,7 @@ EnOcean.prototype.parseProfile = function (nodeId) {
defaults: {
deviceType: "thermostat",
metrics: {
scaleTitle: scale,
scaleTitle: scale, // TODO!!! Check if F scale is defined in EnOcean
level: '',
min: 5,
max: 40,
Expand Down
12 changes: 6 additions & 6 deletions modules/ThermostatDevice/index.js
Expand Up @@ -35,10 +35,10 @@ ThermostatDevice.prototype.init = function (config) {
defaults: {
deviceType: "thermostat",
metrics: {
scaleTitle: '°C',
level: 18,
min: 5,
max: 40,
scaleTitle: this.config.scale === 'C' ? '°C' : '°F',
level: this.config.scale === 'C' ? 18 : 65,
min: this.config.scale === 'C' ? 5 : 41,
max: this.config.scale === 'C' ? 40 : 104,
icon: '',
title: 'Thermostat Device ' + this.id
}
Expand All @@ -52,15 +52,15 @@ ThermostatDevice.prototype.init = function (config) {
});

this.controller.devices.on(this.config.sensor, 'change:metrics:level', function() {
self.checkTemp();
self.checkTemp();
});
};

ThermostatDevice.prototype.stop = function () {
var self = this;

this.controller.devices.off(this.config.sensor, 'change:metrics:level', function() {
self.checkTemp();
self.checkTemp();
});

if (this.vDev) {
Expand Down
5 changes: 4 additions & 1 deletion modules/ThermostatDevice/lang/de.json
Expand Up @@ -7,5 +7,8 @@
"heat":"Heizen",
"cool":"Kühlen",
"l_hysteresis":"Hysteresis",
"h_hysteresis":"Maximaler Bereich zwischen Ist- und Solltemperatur, nachdem sich das Thermostat an/ausschalten soll."
"h_hysteresis":"Maximaler Bereich zwischen Ist- und Solltemperatur, nachdem sich das Thermostat an/ausschalten soll.",
"l_scale": "Scale",
"scale_C": "°C",
"scale_F": "°F"
}
5 changes: 4 additions & 1 deletion modules/ThermostatDevice/lang/en.json
Expand Up @@ -7,5 +7,8 @@
"heat":"Heat",
"cool":"Cool",
"l_hysteresis":"Hysteresis",
"h_hysteresis":"Maximal delta between current and target temperature after which thermostat should turn on/off"
"h_hysteresis":"Maximal delta between current and target temperature after which thermostat should turn on/off",
"l_scale": "Scale",
"scale_C": "°C",
"scale_F": "°F"
}
5 changes: 4 additions & 1 deletion modules/ThermostatDevice/lang/ru.json
Expand Up @@ -7,5 +7,8 @@
"heat":"Обогрев",
"cool":"Охлаждение",
"l_hysteresis":"Гистерезис",
"h_hysteresis":"Максимальная температура коридора между текущем значением температуры и температурой после которой реле должно включиться/выключиться"
"h_hysteresis":"Максимальная температура коридора между текущем значением температуры и температурой после которой реле должно включиться/выключиться",
"l_scale": "Шкала",
"scale_C": "°C",
"scale_F": "°F"
}
14 changes: 12 additions & 2 deletions modules/ThermostatDevice/module.json
Expand Up @@ -6,7 +6,7 @@
"homepage": "http://razberry.z-wave.me",
"icon": "icon.png",
"moduleName":"ThermostatDevice",
"version": "1.0.0",
"version": "1.0.1",
"maturity": "stable",
"repository": {
"type": "git",
Expand All @@ -17,7 +17,8 @@
"description": "__m_descr__",
"switch": "",
"sensor": "",
"heaton": true
"heaton": true,
"scale": "C"
},
"schema": {
"type": "object",
Expand All @@ -42,6 +43,10 @@
"minimum": 0,
"maximum": 5,
"required": true
},
"scale": {
"enum": ["C", "F"],
"required": true
}
},
"required": false
Expand Down Expand Up @@ -71,6 +76,11 @@
"label": "__l_hysteresis__",
"type": "number",
"helper": "__h_hysteresis__"
},
"scale": {
"label": "__l_scale__",
"type": "select",
"optionLabels": ["__scale_C__", "__scale_F__"]
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions modules/ZWave/index.js
@@ -1,6 +1,6 @@
/*** Z-Wave Binding module ********************************************************
Version: 2.0.0
Version: 2.1.2
-------------------------------------------------------------------------------
Author: Serguei Poltorak <ps@z-wave.me>
Copyright: (c) Z-Wave.Me, 2014
Expand Down Expand Up @@ -1848,8 +1848,8 @@ ZWave.prototype.parseAddCommandClass = function (nodeId, instanceId, commandClas
metrics: {
scaleTitle: instance.ThermostatSetPoint.data[mode].scaleString.value,
level: DH.val.value,
min: 5,
max: 40,
min: instance.ThermostatSetPoint.data[mode].scale.value === 0 ? 5 : 41,
max: instance.ThermostatSetPoint.data[mode].scale.value === 0 ? 40 : 104,
icon: 'thermostat',
title: compileTitle("Thermostat " + (mode === MODE_HEAT ? "Heat" : "Cool"), vDevIdNI)
}
Expand Down

0 comments on commit c0f0447

Please sign in to comment.