Skip to content

Commit

Permalink
Inlcude calculed offset for battery
Browse files Browse the repository at this point in the history
On update of battery level, use the calcul (Formule de calcul )
  • Loading branch information
foulek57 committed Apr 6, 2021
1 parent 9d3ce76 commit f786f97
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/class/jMQTTCmd.class.php
Expand Up @@ -138,6 +138,10 @@ public function updateCmdValue($value) {
if ($this->getSubType() == 'binary') {
$this->getEqLogic()->batteryStatus($value ? 100 : 10);
} else {
if ($this->getConfiguration('calculValueOffset') != '') {
$_value = $value;
$value = jeedom::evaluateExpression(str_replace('#value#', $_value, $this->getConfiguration('calculValueOffset')));
}
$this->getEqLogic()->batteryStatus($value);
}
$this->getEqLogic()->log('info', '-> Update battery status');
Expand Down

0 comments on commit f786f97

Please sign in to comment.