Skip to content
Permalink
Browse files

Update magichome.class.php

  • Loading branch information...
directman66 committed Sep 6, 2018
1 parent 6e16491 commit 1df4e50aea37041c78cb1c22cef7acebf28b7aa9
Showing with 6 additions and 6 deletions.
  1. +6 −6 modules/magichome/magichome.class.php
@@ -340,7 +340,7 @@ function search() {
//$msg = bytearray();
//$lead_byte = #0x51
sg('test.magichome',$buf .":".$ip.":".$port);
//sg('test.magichome',$buf .":".$ip.":".$port);
if ($ip) {
@@ -503,7 +503,7 @@ function set_color($id, $R,$G,$B) {
$message="31:$HR:$HG:$HB:00:f0:0f";
$message=str_replace(":","",$message);
$message=$message.$this->csum($message);
sg('test.message', $message);
//sg('test.message', $message);
$hexmessage=hex2bin($message);
socket_sendto($sock, $hexmessage, strlen($hexmessage), 0, $host, $port);
@@ -557,7 +557,7 @@ function brightness($id, $brightness) {
$message="31:00:00:00:".$BR.":f0:0f";
$message=str_replace(":","",$message);
$message=$message.$this->csum($message);
sg('test.message', $message);
//sg('test.message', $message);
$hexmessage=hex2bin($message);
socket_sendto($sock, $hexmessage, strlen($hexmessage), 0, $host, $port);
@@ -595,7 +595,7 @@ function getinfo2($id) {
$message="81:8a:8b";
$message=str_replace(":","",$message);
$message=$message.$this->csum($message);
sg('test.message', $message);
//sg('test.message', $message);
$hexmessage=hex2bin($message);
socket_sendto($sock, $hexmessage, strlen($hexmessage), 0, $host, $port);
@@ -626,7 +626,7 @@ function getinfo2($id) {
//$receiveStrHex = ord($pkt[1]).".".ord($pkt[2]).".".ord($pkt[3]).".".ord($pkt[4]);
// $debug.= "Received message [$receiveStr] <br>";
sg('test.answ', $receiveStrHex);
//sg('test.answ', $receiveStrHex);
SQLexec("update magichome_config set value='$receiveStrHex' where parametr='DEBUG'");
@@ -692,7 +692,7 @@ function getinfo2($id) {
// }
sg('test.rgbbuf', $host.":".$port.":".$buf);
//sg('test.rgbbuf', $host.":".$port.":".$buf);
SQLexec("update magichome_devices set CURRENTCOLOR='$buf' where id='$id'");
}

0 comments on commit 1df4e50

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