Skip to content
Permalink
Browse files

Update magichome.class.php

  • Loading branch information...
directman66 committed Sep 3, 2018
1 parent 3151c2f commit c0fe63a4b460dfde49baa87a4db12a5a833b8c7a
Showing with 19 additions and 1 deletion.
  1. +19 −1 modules/magichome/magichome.class.php
@@ -101,6 +101,7 @@ function run() {
$out['MODE']=$this->mode;
$out['ACTION']=$this->action;
$out['TAB']=$this->tab;
$this->data=$out;
// $this->checkSettings();
@@ -190,7 +191,24 @@ function search() {
//$msg = bytearray();
//$lead_byte = #0x51
sg('test.magichome',$buf .":".$ip.":".$port);
//sg('test.magichome',$buf .":".$ip.":".$port);
if ($ip) {
$mhdevices=SQLSelect("SELECT max(ID) ID FROM magichome_devices");
if ($mhdevices[0]['ID']) {
$id=$mhdevices[0]['ID']+1;} else $id=0;
$par['ID'] = $id;
$par['TITLE'] = 'RGB LED';
$par['IP'] = $ip;
$par['PORT'] = $port;
$par['MAC'] = '';
$par['FIND'] = date('m/d/Y H:i:s',time());
SQLInsert('magichome_devices', $par);
}
socket_close($sock);

0 comments on commit c0fe63a

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