Код: Выделить всё
if ($online == 1) {
$this->setProperty('status', 'Включен');
$this->setProperty('statuscolor', 'green');
if ($Sensor) {
sg($Sensor . '.status', 1);
}
} else {
$this->setProperty('status', 'Выключен');
$this->setProperty('statuscolor', 'red');
if ($Sensor) {
sg($Sensor . '.status', 0);
}
}
если в устройствах онлайн привязано в объект.свойство