сделал следующим образом. не знаю насколько это правильно. я не программист
nightmode_activate.php
было
<?php
if (defined('DISABLE_SIMPLE_DEVICES') && DISABLE_SIMPLE_DEVICES==1) return;
$this->setProperty('active', 1);
//groupNight
$objects = getObjectsByProperty('groupNight', '=', 1);
$total = count($objects);
for ($i = 0; $i < $total; $i++) {
$currentStatus = gg($objects[$i] . '.status');
if ($currentStatus) {
usleep(50000);
callMethodSafe($objects[$i] . '.turnOff, array('source' => 'NightMode'));
}
}
стало
<?php
if (defined('DISABLE_SIMPLE_DEVICES') && DISABLE_SIMPLE_DEVICES==1) return;
//$this->setProperty('active', 1);
//groupNight
$objects = getObjectsByProperty('groupNight', '=', 1);
$total = count($objects);
for ($i = 0; $i < $total; $i++) {
$currentStatus = gg($objects[$i] . '.status');
if ($currentStatus) {
usleep(50000);
callMethodSafe($objects[$i] . '.turnOff', array('source' => 'NightMode'));
}
}
закоментировал строку $this->setProperty('active', 1);
кто знает зачем она нужна, напишите
скопировал nightmode_activate.php как nightmode_deactivate.php
изменил следующим образом
<?php
if (defined('DISABLE_SIMPLE_DEVICES') && DISABLE_SIMPLE_DEVICES==0) return;
//$this->setProperty('active', 0);
//groupNight
$objects = getObjectsByProperty('groupNight', '=', 0);
$total = count($objects);
for ($i = 0; $i < $total; $i++) {
$currentStatus = gg($objects[$i] . '.status');
if ($currentStatus) {
usleep(50000);
callMethodSafe($objects[$i] . '.turnOn', array('source' => 'NightMode'));
}
}
единицы заменил нулями и turnOff на turnOn. напишите что значит turnOff