Skip to content
Permalink
Browse files

Update magichome.class.php

  • Loading branch information...
directman66 committed Oct 5, 2018
1 parent e382fb3 commit 37083e628e6b3c3ac07c771b61e16b03e82de0d7
Showing with 8 additions and 7 deletions.
  1. +8 −7 modules/magichome/magichome.class.php
@@ -280,14 +280,15 @@ function propertySetHandle($object, $property, $value) {
$magichomeObject->getinfo2($deviceid);
}
if ($command=='color') {
$colorhex=$value;
$colorhex=str_replace('#','',$value);
$ar =(str_split($colorhex, 2));
$magichomeObject->set_colorhex($cid, $ar[0],$ar[1],$ar[2]);
$magichomeObject->getinfo2($cid, $debug);
sg('test.newcolor',$colorhex);
$magichomeObject->set_colorhex($deviceid, $ar[0],$ar[1],$ar[2]);
$magichomeObject->getinfo2($deviceid, $debug);
}
} //model
} //цикл девайсов
} //цикл девайсов
}//if total
@@ -779,7 +780,7 @@ function getinfo2($id=0) {
if ($properties[$i]['TITLE']=='status') {
if (substr($buf,4,2)=='23') {$newvalue=1;} else {$newvalue=0;}
}
elseif ($properties[$i]['TITLE']=='color') $newvalue=substr($buf,13,6);
elseif ($properties[$i]['TITLE']=='color') {$newvalue='#'.str_replace('#','',substr($buf,12,6));}
elseif ($properties[$i]['TITLE']=='level') $newvalue=substr($buf,10,3);
else $newvalue=$buf;
@@ -963,8 +964,8 @@ function csum($str)
//info 81:8a:8b:96
//РІРєР» 71:23:0f:a3
//выкл 71:24:0f:a4
//РІРєР» 71:23:0f:a3
//выкл 71:24:0f:a4
//color 1 1 1 31:01:01:01:00:f0:0f:33
//3100:00:00:00:f0:0f:30
//3100ff0000f00f2f

0 comments on commit 37083e6

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