debug
This commit is contained in:
parent
4e04dfdfd6
commit
247d1fd17d
@ -13,12 +13,15 @@ class rdc_temperature_int_ext extends hook
|
||||
public function callBack(&$device, $property, $value)
|
||||
{
|
||||
global $indexDevices;
|
||||
if ($device->properties["indoortempc"]["value"] > $value)
|
||||
static $status = 0;
|
||||
if ($device->properties["indoortempc"]["value"] > $value and $status === 1)
|
||||
{
|
||||
logger(ALERT, _("Indoor temperature is superior to outdoor one"))
|
||||
}elseif ($device->properties["indoortempc"]["value"] < $value)
|
||||
$status = 0;
|
||||
logger(ALERT, _("Indoor temperature is superior to outdoor one"));
|
||||
}elseif ($device->properties["indoortempc"]["value"] < $value and $status === 0)
|
||||
{
|
||||
logger(ALERT, _("Indoor temperature is inferior to outdoor one"))
|
||||
$status = 1;
|
||||
logger(ALERT, _("Indoor temperature is inferior to outdoor one"));
|
||||
}
|
||||
logger (INFO, sprintf(_("%s: notification received from MQTT from %s => parameter: %s value: %s"), $this->hookName, $device->friendlyName, $property, bool2string($value)), __FILE__ . ":" . __LINE__);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user