Skip to content

Commit

Permalink
Update thermostat.class.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc committed Mar 10, 2023
1 parent 69061bc commit 003f0d6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/class/thermostat.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public static function hysteresis($_options) {
log::add(__CLASS__, 'error', $thermostat->getHumanName() . ' ' . __('Attention il n\'y a pas eu de mise à jour de la température depuis plus de', __FILE__) . ' : ' . $thermostat->getConfiguration('maxTimeUpdateTemp') . 'min (' . $cmd->getCollectDate() . ')');
}
$thermostat->setCache('temp_threshold', 1);
$thermostat->getCmd(null, 'status')->event(__('Défaillance sonde', __FILE__));
return;
}
$thermostat->setCache('temp_threshold', 0);
Expand Down Expand Up @@ -216,6 +217,7 @@ public static function temporal($_options) {
}
log::add(__CLASS__, 'debug', $thermostat->getHumanName() . ' ' . __('Je ne fais rien car il n\'y a pas eu de mise a jour de la température depuis plus de', __FILE__) . ' ' . $thermostat->getConfiguration('maxTimeUpdateTemp'). ' '.__('minutes',__FILE__));
$thermostat->setCache('temp_threshold', 1);
$thermostat->getCmd(null, 'status')->event(__('Défaillance sonde', __FILE__));
return;
}
$temp_out = $thermostat->getCmd(null, 'temperature_outdoor')->execCmd();
Expand All @@ -225,6 +227,7 @@ public static function temporal($_options) {
}
log::add(__CLASS__, 'debug', $thermostat->getHumanName() . ' ' . __('Je ne fais rien car la température intérieure n\'est pas un numérique', __FILE__));
$thermostat->setCache('temp_threshold', 1);
$thermostat->getCmd(null, 'status')->event(__('Défaillance sonde', __FILE__));
return;
}
$thermostat->setCache('temp_threshold', 0);
Expand Down Expand Up @@ -1479,6 +1482,7 @@ public function postSave() {
}

public function heat($_repeat = false) {
$this->getCmd(null, 'status')->event(__('Chauffage', __FILE__));
if (!$_repeat) {
if ($this->getCmd(null, 'mode')->execCmd() == __('Off', __FILE__) || $this->getCmd(null, 'status')->execCmd() == __('Suspendu', __FILE__)) {
return false;
Expand Down Expand Up @@ -1514,14 +1518,14 @@ public function heat($_repeat = false) {
}
if (!$_repeat) {
$this->refresh();
$this->getCmd(null, 'status')->event(__('Chauffage', __FILE__));
$this->setCache('lastState', 'heat');
$this->getCmd(null, 'actif')->event(1);
}
return true;
}

public function cool($_repeat = false) {
$this->getCmd(null, 'status')->event(__('Climatisation', __FILE__));
if (!$_repeat) {
if ($this->getCmd(null, 'mode')->execCmd() == __('Off', __FILE__) || $this->getCmd(null, 'status')->execCmd() == __('Suspendu', __FILE__)) {
return false;
Expand Down Expand Up @@ -1557,7 +1561,6 @@ public function cool($_repeat = false) {
}
if (!$_repeat) {
$this->refresh();
$this->getCmd(null, 'status')->event(__('Climatisation', __FILE__));
$this->setCache('lastState', 'cool');
$this->getCmd(null, 'actif')->event(1);
}
Expand Down

0 comments on commit 003f0d6

Please sign in to comment.