mirror of
https://github.com/koush/scrypted.git
synced 2026-02-10 09:12:03 +00:00
thermostat: handle mode auto
This commit is contained in:
4
plugins/thermostat/package-lock.json
generated
4
plugins/thermostat/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/thermostat",
|
||||
"version": "0.0.27",
|
||||
"version": "0.0.29",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/thermostat",
|
||||
"version": "0.0.27",
|
||||
"version": "0.0.29",
|
||||
"license": "Apache",
|
||||
"devDependencies": {
|
||||
"@scrypted/sdk": "file:../../sdk"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/thermostat",
|
||||
"version": "0.0.27",
|
||||
"version": "0.0.29",
|
||||
"description": "Create a virtual thermostat from a temperature sensor and smart plug connected to heater or AC unit.",
|
||||
"author": "Scrypted",
|
||||
"license": "Apache",
|
||||
@@ -26,8 +26,7 @@
|
||||
"Settings",
|
||||
"Thermometer",
|
||||
"TemperatureSetting",
|
||||
"HumiditySensor",
|
||||
"HumiditySetting"
|
||||
"HumiditySensor"
|
||||
],
|
||||
"type": "Thermostat"
|
||||
},
|
||||
|
||||
@@ -295,10 +295,10 @@ class ThermostatDevice extends ScryptedDeviceBase implements TemperatureSetting,
|
||||
}
|
||||
async setThermostatMode(mode) {
|
||||
log.i('thermostat mode set to ' + mode);
|
||||
if (mode == 'On') {
|
||||
if (mode === ThermostatMode.On || mode == ThermostatMode.Auto) {
|
||||
mode = this.storage.getItem("lastThermostatMode");
|
||||
}
|
||||
else if (mode != 'Off') {
|
||||
else if (mode != ThermostatMode.Off) {
|
||||
this.storage.setItem("lastThermostatMode", mode);
|
||||
}
|
||||
this.thermostatMode = mode;
|
||||
|
||||
Reference in New Issue
Block a user