Skip to content
Permalink
Browse files

Накопительное обновление

  • Loading branch information...
Alexandr-logrus committed Sep 10, 2019
1 parent 3667fed commit 5ba9e5f5122d4acbaf4cb83c3489bf5d6ea945f2
@@ -4,7 +4,22 @@
$action = $this->getProperty('actionRGB');
if (isset($params['color'])) {
$this->callMethod('setColor', array('color'=> $params['color']));
//$this->callMethod('setColor', array('color'=> $params['color']));
if (isset($params['brightness'])) {
$brightnessHex = dechex($params['brightness']);
if (strlen($brightnessHex) == '1') {
$brightnessHex = '0' . $brightnessHex;
}
$this->setProperty('color', $brightnessHex . $params['color']);
} else {
$brightnessHex = dechex($this->getProperty('brightnessSaved'));//тодо
if (strlen($brightnessHex) == '1') {
$brightnessHex = '0' . $brightnessHex;
}
$this->setProperty('color', $brightnessHex . $params['color']);
}
if (isset($params['timer'])) {
setTimeout($ot . '_timerAction', 'callMethod("' . $ot . '.action");', $params['timer']);
}
@@ -1,10 +1,10 @@
<?php
$color = $params['NEW_VALUE'];
if ($params['NEW_VALUE'] == $params['OLD_VALUE']) return;
if ($color != '000000') {
$this->setProperty('colorSaved', $color);
if ($params['NEW_VALUE'] != '000000') {
$this->setProperty('colorSaved', $params['NEW_VALUE']);
$this->setProperty('status', 1);
} else {
$this->setProperty('status', 0);
}
}
@@ -3,12 +3,12 @@
$colorSaved = $this->getProperty('colorSaved');
$brightnessHex = dechex($this->getProperty('brightnessSaved'));
if (strlen($brightnessHex) == '1') {
if (strlen($brightnessHex) == 1) {
$brightnessHex = '0' . $brightnessHex;
}
if (isset($colorSaved) && $colorSaved != '000000') {
$this->setProperty('color', $brightnessHex . $colorSaved);
} else {
$this->setProperty('color', $brightnessHex . 'ffffff');
}
}

0 comments on commit 5ba9e5f

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