Skip to content
Permalink
Browse files

fix

оптимизировал количество обновлений статуса
  • Loading branch information...
Alexandr-logrus committed Nov 29, 2018
1 parent bf8954f commit a84d17f4bb6492b14147225a5d93015a30574978
@@ -1,9 +1,9 @@
<?php
if ($this->getProperty('bright')>0) {
if ($this->getProperty('bright') > 0) {
$this->setProperty('saved_bright', $this->getProperty('bright'));
$this->setProperty('cct', $this->getProperty('cct'));
$this->setProperty('status', 1);
} else {
$this->setProperty('status', 0);
if ($this->getProperty('status') == 0) {
$this->setProperty('status', 1);
}
}
@@ -1,3 +1,5 @@
<?php
$this->setProperty('status', 1);
if ($this->getProperty('status') == 0) {
$this->setProperty('status', 1);
}
@@ -1,8 +1,6 @@
<?php
$currentStatus=$this->getProperty('status');
if ($currentStatus) {
if ($this->getProperty('status')) {
$this->callMethod('turnOff');
} else {
$this->callMethod('turnOn');
@@ -1,8 +1,6 @@
<?php
if ($this->getProperty('bright') == 0) {
//if ($this->getProperty('bright') == 0) {
$this->setProperty('cct', $this->getProperty('cct'));
$this->setProperty('bright', $this->getProperty('saved_bright'));
} else {
$this->setProperty('bright', $this->getProperty('bright'));
}
//}

0 comments on commit a84d17f

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