Skip to content
Permalink
Browse files

Merge pull request #546 from Alexandr-logrus/alpha

fix
  • Loading branch information...
sergejey committed May 9, 2019
2 parents 975f59b + 14b80cf commit bcc6e51a5afcbf9798bdf78e6fa22a858d49bece
@@ -1,7 +1,6 @@
<?php
$currentStatus=$this->getProperty('status');
if ($currentStatus) {
if ($this->getProperty('status')) {
$this->callmethodSafe('turnOff');
} else {
$this->callmethodSafe('turnOn');
@@ -1,4 +1,3 @@
<?php
$this->setProperty('status', 1);
$this->setProperty('status', 1);
@@ -50,5 +50,5 @@
$this->callMethod('logicAction');
include_once(DIR_MODULES . 'devices/devices.class.php');
$dv = new devices();
$dv->checkLinkedDevicesAction($this->object_title, $value);
$dv->checkLinkedDevicesAction($ot, $params['NEW_VALUE']);
//}
@@ -1,12 +1,14 @@
<?php
$status = $this->getProperty('status');
$this->setProperty('updated', time());
$status = $params['NEW_VALUE'];
$tm=time();
$this->setProperty('updated', $tm);
//$this->setProperty('alive', 1);
$group_name=$this->getProperty('groupName');
$objects = getObjectsByProperty('group'.$group_name,1);
$group_name = $this->getProperty('groupName');
$objects = getObjectsByProperty('group' . $group_name, 1);
foreach($objects as $object_title) {
sg($object_title.'.status',$status);
if (getGlobal($object_title . '.status') != $status) {
usleep(50000);
setGlobal($object_title . '.status', $status);
//sleep(1);
}
}
@@ -1,15 +1,7 @@
<?php
/*
$group_name=$this->getProperty('groupName');
$objects = getObjectsByProperty('group'.$group_name,1);
foreach($objects as $object_title) {
callMethod($object_title.'.switch');
}
*/
if ($this->getProperty('status')) {
$this->setProperty('status', 0);
$this->setProperty('status', 0);
} else {
$this->setProperty('status', 1);
$this->setProperty('status', 1);
}
@@ -1,8 +1,3 @@
<?php
$group_name=$this->getProperty('groupName');
$objects = getObjectsByProperty('group'.$group_name,1);
foreach($objects as $object_title) {
callMethod($object_title.'.turnOff');
}
$this->setProperty('status', 0);
@@ -1,8 +1,3 @@
<?php
$group_name=$this->getProperty('groupName');
$objects = getObjectsByProperty('group'.$group_name,1);
foreach($objects as $object_title) {
callMethod($object_title.'.turnOn');
}
$this->setProperty('status', 1);
@@ -3,8 +3,10 @@
if (defined('DISABLE_SIMPLE_DEVICES') && DISABLE_SIMPLE_DEVICES==1) return;
//groupSunset
$objects=getObjectsByProperty('groupSunset','=',1);
$objects = getObjectsByProperty('groupSunset', '=', 1);
$total = count($objects);
for ($i = 0; $i < $total; $i++) {
callMethodSafe($objects[$i].'.turnOn');
}
usleep(50000);
callMethodSafe($objects[$i] . '.turnOn');
//sleep(1);
}
@@ -3,8 +3,12 @@
if (defined('DISABLE_SIMPLE_DEVICES') && DISABLE_SIMPLE_DEVICES==1) return;
//groupSunrise
$objects=getObjectsByProperty('groupSunrise','=',1);
$objects = getObjectsByProperty('groupSunrise', '=', 1);
$total = count($objects);
for ($i = 0; $i < $total; $i++) {
callMethodSafe($objects[$i].'.turnOff');
if (getGlobal($objects[$i] . '.status')) {
usleep(50000);
callMethodSafe($objects[$i] . '.turnOff');
//sleep(1);
}
}
@@ -3,9 +3,12 @@
if (defined('DISABLE_SIMPLE_DEVICES') && DISABLE_SIMPLE_DEVICES==1) return;
//groupEco
$objects=getObjectsByProperty('groupEco','=',1);
$objects = getObjectsByProperty('groupEco', '=', 1);
$total = count($objects);
for ($i = 0; $i < $total; $i++) {
callMethodSafe($objects[$i].'.turnOff');
if (getGlobal($objects[$i] . '.status')) {
usleep(50000);
callMethodSafe($objects[$i] . '.turnOff');
//sleep(1);
}
}
}
@@ -2,9 +2,11 @@
if (defined('DISABLE_SIMPLE_DEVICES') && DISABLE_SIMPLE_DEVICES==1) return;
//groupEco
$objects=getObjectsByProperty('groupEcoOn','=',1);
//groupEcoOn
$objects = getObjectsByProperty('groupEcoOn', '=', 1);
$total = count($objects);
for ($i = 0; $i < $total; $i++) {
callMethodSafe($objects[$i].'.turnOn');
usleep(50000);
callMethodSafe($objects[$i] . '.turnOn');
//sleep(1);
}

0 comments on commit bcc6e51

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