Skip to content

Commit

Permalink
Merge pull request #549 from Alexandr-logrus/alpha
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
sergejey committed May 11, 2019
2 parents fd0f34b + 55541ba commit 19a20f2
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 19 deletions.
24 changes: 12 additions & 12 deletions modules/devices/Rooms_onActivity.php
Expand Up @@ -2,24 +2,24 @@


if (defined('DISABLE_SIMPLE_DEVICES') && DISABLE_SIMPLE_DEVICES==1) return; if (defined('DISABLE_SIMPLE_DEVICES') && DISABLE_SIMPLE_DEVICES==1) return;


$ot=$this->object_title; $ot = $params['object'];


$latestActivity=$this->getProperty('LatestActivity'); //$latestActivity = $this->getProperty('LatestActivity');
$this->setProperty('LatestActivity',time()); $this->setProperty('LatestActivity', time());
$this->setProperty('LatestActivityTime',date('H:i')); $this->setProperty('LatestActivityTime', date('H:i'));


if (!$this->getProperty('SomebodyHere')) { if (!$this->getProperty('SomebodyHere')) {
$this->setProperty('SomebodyHere',1); $this->setProperty('SomebodyHere', 1);
$this->callMethod("updateActivityStatus"); $this->callMethod('updateActivityStatus');
} }


if ($this->getProperty("IdleDelay")) { if ($this->getProperty('IdleDelay')) {
$activity_timeout=(int)$this->getProperty("IdleDelay"); $activity_timeout = (int)$this->getProperty('IdleDelay');
} else { } else {
$activity_timeout=10*60; $activity_timeout = 10*60;
} }
setTimeOut($ot."_activity_timeout","callMethod('".$ot.".onIdle');",$activity_timeout); setTimeOut($ot . '_activity_timeout', "callMethod('" . $ot . ".onIdle');", $activity_timeout);


if (getGlobal('NobodyHomeMode.active')) { if (getGlobal('NobodyHomeMode.active')) {
callMethod('NobodyHomeMode.deactivate',array('sensor'=>$params['sensor'],'room'=>$ot)); callMethod('NobodyHomeMode.deactivate', array('sensor' => $params['sensor'], 'room' => $ot));
} }
2 changes: 1 addition & 1 deletion modules/devices/Rooms_onIdle.php
@@ -1,3 +1,3 @@
<?php <?php


$this->callMethod("updateActivityStatus"); $this->callMethod('updateActivityStatus');
6 changes: 5 additions & 1 deletion modules/devices/SGroups_statusUpdated.php
Expand Up @@ -8,7 +8,11 @@
foreach($objects as $object_title) { foreach($objects as $object_title) {
if (getGlobal($object_title . '.status') != $status) { if (getGlobal($object_title . '.status') != $status) {
usleep(50000); usleep(50000);
setGlobal($object_title . '.status', $status); if ($status) {
callMethodSafe($object_title . '.turnOn', array('sourse' => $params['ORIGINAL_OBJECT_TITLE']));
} else {
callMethodSafe($object_title . '.turnOff', array('sourse' => $params['ORIGINAL_OBJECT_TITLE']));
}
//sleep(1); //sleep(1);
} }
} }
2 changes: 1 addition & 1 deletion modules/devices/darknessmode_activate.php
Expand Up @@ -7,6 +7,6 @@
$total = count($objects); $total = count($objects);
for ($i = 0; $i < $total; $i++) { for ($i = 0; $i < $total; $i++) {
usleep(50000); usleep(50000);
callMethodSafe($objects[$i] . '.turnOn'); callMethodSafe($objects[$i] . '.turnOn', array('sourse' => $params['object']));
//sleep(1); //sleep(1);
} }
2 changes: 1 addition & 1 deletion modules/devices/darknessmode_deactivate.php
Expand Up @@ -8,7 +8,7 @@
for ($i = 0; $i < $total; $i++) { for ($i = 0; $i < $total; $i++) {
if (getGlobal($objects[$i] . '.status')) { if (getGlobal($objects[$i] . '.status')) {
usleep(50000); usleep(50000);
callMethodSafe($objects[$i] . '.turnOff'); callMethodSafe($objects[$i] . '.turnOff', array('sourse' => $params['object']));
//sleep(1); //sleep(1);
} }
} }
2 changes: 1 addition & 1 deletion modules/devices/econommode_activate.php
Expand Up @@ -8,7 +8,7 @@
for ($i = 0; $i < $total; $i++) { for ($i = 0; $i < $total; $i++) {
if (getGlobal($objects[$i] . '.status')) { if (getGlobal($objects[$i] . '.status')) {
usleep(50000); usleep(50000);
callMethodSafe($objects[$i] . '.turnOff'); callMethodSafe($objects[$i] . '.turnOff', array('sourse' => $params['object']));
//sleep(1); //sleep(1);
} }
} }
2 changes: 1 addition & 1 deletion modules/devices/econommode_deactivate.php
Expand Up @@ -7,6 +7,6 @@
$total = count($objects); $total = count($objects);
for ($i = 0; $i < $total; $i++) { for ($i = 0; $i < $total; $i++) {
usleep(50000); usleep(50000);
callMethodSafe($objects[$i] . '.turnOn'); callMethodSafe($objects[$i] . '.turnOn', array('sourse' => $params['object']));
//sleep(1); //sleep(1);
} }
2 changes: 1 addition & 1 deletion modules/devices/nobodyhomemode_activate.php
Expand Up @@ -2,7 +2,7 @@


if (defined('DISABLE_SIMPLE_DEVICES') && DISABLE_SIMPLE_DEVICES==1) return; if (defined('DISABLE_SIMPLE_DEVICES') && DISABLE_SIMPLE_DEVICES==1) return;


ClearTimeOut("nobodyHome"); clearTimeOut('nobodyHome');
require(DIR_MODULES.'devices/Rooms_updateActivityStatus.php'); require(DIR_MODULES.'devices/Rooms_updateActivityStatus.php');


if (!gg('EconomMode.active')) { if (!gg('EconomMode.active')) {
Expand Down

0 comments on commit 19a20f2

Please sign in to comment.