Skip to content
Permalink
Browse files

Merge pull request #551 from Alexandr-logrus/alpha

fix
  • Loading branch information...
sergejey committed May 13, 2019
2 parents 87c2600 + 824210a commit b047d694dc55886f87541e55cbe371bafaa35e28
@@ -4,8 +4,7 @@
$linked_room = $this->getProperty('linkedRoom');
if ($this->class_title != 'SMotions' || $params['NEW_VALUE']) {
$tm = time();
$this->setProperty('updated', $tm);
$this->setProperty('updated', time());
$this->callMethod('setUpdatedText');
}
if ($this->getProperty('alive') == 0) {
@@ -9,9 +9,9 @@
if (getGlobal($object_title . '.status') != $status) {
usleep(50000);
if ($status) {
callMethodSafe($object_title . '.turnOn', array('sourse' => $params['ORIGINAL_OBJECT_TITLE']));
callMethodSafe($object_title . '.turnOn', array('source' => $params['ORIGINAL_OBJECT_TITLE']));
} else {
callMethodSafe($object_title . '.turnOff', array('sourse' => $params['ORIGINAL_OBJECT_TITLE']));
callMethodSafe($object_title . '.turnOff', array('source' => $params['ORIGINAL_OBJECT_TITLE']));
}
//sleep(1);
}
@@ -3,8 +3,7 @@
$ot = $this->object_title;
$ncno = $this->getProperty('ncno');
$tm = time();
$this->setProperty('updated', $tm);
$this->setProperty('updated', time());
$this->callMethodSafe('setUpdatedText');
if ($this->getProperty('alive') == 0) {
$this->setProperty('alive', 1);
@@ -28,7 +27,7 @@
$nobodyhome_timeout = SETTINGS_BEHAVIOR_NOBODYHOME_TIMEOUT * 60;
}
if ($nobodyhome_timeout) {
setTimeOut("nobodyHome", "callMethodSafe('NobodyHomeMode.activate');", $nobodyhome_timeout);
setTimeOut('nobodyHome', "callMethodSafe('NobodyHomeMode.activate');", $nobodyhome_timeout);
}
if ($linked_room) {
callMethodSafe($linked_room . '.onActivity', array('sensor' => $ot));
@@ -65,4 +64,4 @@
include_once(DIR_MODULES . 'devices/devices.class.php');
$dv = new devices();
$dv->checkLinkedDevicesAction($this->object_title, $this->getProperty('status'));
$dv->checkLinkedDevicesAction($ot, $params['NEW_VALUE']);
@@ -7,34 +7,34 @@
$min_value = (float)$this->getProperty('minValue');
$loadTimeout = $this->getProperty('loadStatusTimeout');
$tmp=explode(',',$loadTimeout);
$tmp=array_map('trim',$tmp);
$onTimeout=(int)$tmp[0];
$tmp = explode(',', $loadTimeout);
$tmp = array_map('trim', $tmp);
$onTimeout = (int)$tmp[0];
if ($tmp[1]) {
$offTimeout=(int)$tmp[1];
$offTimeout = (int)$tmp[1];
} else {
$offTimeout=$onTimeout;
$offTimeout = $onTimeout;
}
if (!$min_value) {
$min_value=1;
$min_value = 1;
}
$timerOn=$ot.'_turned_on';
$timerOff=$ot.'_turned_off';
$timerOn = $ot . '_turned_on';
$timerOff = $ot . '_turned_off';
if ($currentValue>=$min_value) {
if ($currentValue >= $min_value) {
if (!$status) {
clearTimeout($timerOff);
if (!timeOutExists($timerOn)) {
setTimeout($timerOn,'setGlobal("'.$ot.'.status",1);callMethod("'.$ot.'.loadStatusChanged",array("status"=>1));',$onTimeout);
setTimeout($timerOn, 'setGlobal("' . $ot . '.status", 1);callMethod("' . $ot . '.loadStatusChanged", array("status"=>1));', $onTimeout);
}
}
} elseif ($currentValue<$min_value) {
if ($status) {
clearTimeOut($timerOn);
if (!timeOutExists($timerOff)) {
setTimeout($timerOff, 'setGlobal("' . $ot . '.status",0);callMethod("' . $ot . '.loadStatusChanged",array("status"=>0));', $offTimeout);
setTimeout($timerOff, 'setGlobal("' . $ot . '.status", 0);callMethod("' . $ot . '.loadStatusChanged", array("status"=>0));', $offTimeout);
}
}
}
@@ -38,8 +38,7 @@
} elseif ($data1 < $value) {
$direction = 1;
}
$currentDirection = $this->getProperty('direction');
if ($currentDirection != $direction) {
if ($this->getProperty('direction') != $direction) {
$this->setProperty('direction', $direction);
}
@@ -7,6 +7,6 @@
$total = count($objects);
for ($i = 0; $i < $total; $i++) {
usleep(50000);
callMethodSafe($objects[$i] . '.turnOn', array('sourse' => 'DarknessMode'));
callMethodSafe($objects[$i] . '.turnOn', array('source' => 'DarknessMode'));
//sleep(1);
}
@@ -8,7 +8,7 @@
for ($i = 0; $i < $total; $i++) {
if (getGlobal($objects[$i] . '.status')) {
usleep(50000);
callMethodSafe($objects[$i] . '.turnOff', array('sourse' => 'DarknessMode'));
callMethodSafe($objects[$i] . '.turnOff', array('source' => 'DarknessMode'));
//sleep(1);
}
}
@@ -8,7 +8,7 @@
for ($i = 0; $i < $total; $i++) {
if (getGlobal($objects[$i] . '.status')) {
usleep(50000);
callMethodSafe($objects[$i] . '.turnOff', array('sourse' => 'EconomMode'));
callMethodSafe($objects[$i] . '.turnOff', array('source' => 'EconomMode'));
//sleep(1);
}
}
@@ -7,6 +7,6 @@
$total = count($objects);
for ($i = 0; $i < $total; $i++) {
usleep(50000);
callMethodSafe($objects[$i] . '.turnOn', array('sourse' => 'EconomMode'));
callMethodSafe($objects[$i] . '.turnOn', array('source' => 'EconomMode'));
//sleep(1);
}

0 comments on commit b047d69

Please sign in to comment.
You can’t perform that action at this time.