Skip to content

Commit 998acc7

Browse files
committed
Thermostat update
* Simple devices - thermostat logic adjustment
1 parent f1429b5 commit 998acc7

5 files changed

+14
-11
lines changed
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
<?php
22

33
$this->setProperty('disabled', 1);
4-
$this->setProperty('relay_status', 0); // turn off
4+
$this->setProperty('relay_status', 0); // turn off relay
5+
6+
$currentTemperature = $this->getProperty('value');
7+
include_once(dirname(__FILE__).'/devices.class.php');
8+
$dv=new devices();
9+
$dv->checkLinkedDevicesAction($this->object_title, $currentTemperature);
10+
$this->callMethod('logicAction');
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?php
22

33
if ($this->getProperty('disabled')) {
4-
$this->setProperty('disabled', 0);
4+
$this->callMethod('enable');
55
} else {
6-
$this->setProperty('disabled', 1);
7-
$this->setProperty('relay_status', 0); // turn off
6+
$this->callMethod('disable');
87
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
<?php
22

33
$this->setProperty('status', 0);
4-
$this->callMethod('enable');
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
<?php
22

3-
$this->setProperty('status', 1);
4-
$this->callMethod('enable');
3+
$this->setProperty('status', 1);

modules/devices/SThermostats_valueUpdated.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
if ($currentTemperature > ($targetTemperature+$threshold)) { // temperature too high
2929
//$need_action = 1;
3030
if ($ncno == 'no') {
31-
$this->setProperty('relay_status',1); // turn on
31+
$this->setProperty('relay_status',1); // turn on (cooling on)
3232
} else {
33-
$this->setProperty('relay_status',0); // turn off
33+
$this->setProperty('relay_status',0); // turn off (heating off)
3434
}
3535
} elseif ($currentTemperature < ($targetTemperature-$threshold)) { // temperature too low
3636
//$need_action = 1;
3737
if ($ncno == 'no') {
38-
$this->setProperty('relay_status',0); // turn off
38+
$this->setProperty('relay_status',0); // turn off (cooling off)
3939
} else {
40-
$this->setProperty('relay_status',1); // turn on
40+
$this->setProperty('relay_status',1); // turn on (heating on)
4141
}
4242
}
4343
//echo "current: $currentTemperature target: $targetTemperature action: $need_action <br/>";

0 commit comments

Comments
 (0)