Свойства класса:
Методы класса:
Объекты класса:
Свойства класса:
Объекты класса:
Свойства класса:
Методы класса:
$this->setProperty('UpdatedTime',time()); $this->setProperty('Value', $params['Value']); $this->setProperty("Actual",1); //str='http://10.10.16.50/objects/?object=ekb_esp&op=set&p=dhtt1&v='+'($this->getProperty('Street_temp.Value'))'; //getURL('http://10.10.16.50/objects/?object=ekb_esp&op=set&p=dhtt1&v='.($this->getProperty('Street_temp.Value')).'', 0); //$str=gg('Street_temp.Value'); //Say($str,5); //getURL(str,0); //getURL('http://10.10.16.50/objects/?object=ekb_esp&op=set&p=dhtt1&v='+$str+'', 0); //Новое для алертов pushbullet, telegram if (($this->getProperty('ValueMIN') <> "") and ($this->getProperty('ValueMAX') <> "") and ($this->getProperty('Tepl1_temp.Voice_teplica') <> 0)) { if (($params['Value'] < $this->getProperty('ValueMIN')) or ($params['Value'] > $this->getProperty('ValueMAX'))) { if ($this->getProperty('ValueActual') <> 1) { $this->setProperty('ValueActual',1); //say(''$this->getProperty('Say')''.gg('$params['Value']'),5); //say('Нештатная '.$this->getProperty('SayMAX').' '.$this->getProperty('Value'),5); say($this->getProperty('SayMAX').' '.$this->getProperty('Value'),5); } } else { if (($this->getProperty('ValueActual') <> 0) and ($this->getProperty('Tepl1_temp.Voice_teplica') <> 0)) { $this->setProperty('ValueActual',0); say($this->getProperty('SayMIN').' '.$this->getProperty('Value'),5); } } } //$this->setProperty('updatedTimestamp',time()); //Новое для алертов pushbullet, telegram $object_title=$this->object_title; $actuality_period=(int)$this->getProperty("ActualityPeriod"); if (!$actuality_period) { $actuality_period=12*60*60; } clearTimeOut($object_title."_actual"); clearTimeOut($object_title."_value"); setTimeOut($object_title."_actual".$actuality_period,"setGlobal('".$object_title.".Actual',0);",$actuality_period); setTimeOut($object_title."_value".$actuality_period,"setGlobal('".$object_title.".Value',-1000);",$actuality_period);
Объекты класса:
$this->setProperty('UpdatedTime',time()); $this->setProperty('Value', $params['Value']); $this->setProperty("Actual",1); $object_title=$this->object_title; $actuality_period=(int)$this->getProperty("ActualityPeriod"); if (!$actuality_period) { $actuality_period=12*60*60; } clearTimeOut($object_title."_actual"); clearTimeOut($object_title."_value"); setTimeOut($object_title."_actual".$actuality_period,"setGlobal('".$object_title.".Actual',0);",$actuality_period); setTimeOut($object_title."_value".$actuality_period,"setGlobal('".$object_title.".Value',-1000);",$actuality_period);
Свойства класса:
Методы класса:
$tm = time() - gg("camera1.time"); // временно if (time() - gg("camera1.time") > (gg("camera1.time_rec"))) { include_once(DIR_MODULES . 'telegram/telegram.class.php'); sg("camera1.time",time()); //$telegram_module = new telegram(); //$telegram_module->sendMessageToAll($tm); $h=(int)date('G',time()); $m=date('i',time()); if (isWeekDay()) { } //if (($h>=8) && getGlobal('clockChimeEnabled')) { if (($h>=8) and ($h<=22) and (getGlobal('AlarmKamEnable'))) { //if ($m=="00") { //say(timeNow(),1); //say(timeNow(),2); say('У ворот зафиксировано движение',5); //Отправка видео в теолеграмм при обнаружении движения exec('C:\_majordomo\apps\ffmpeg\ffmpeg.exe -y -i "rtsp://10.10.14.11:554/user=admin_password=tlJwpbo6_channel=1_stream=0.sdp?real_stream" -t 10 -f mp4 -vcodec libx264 -pix_fmt yuv420p -an -vf scale=w=640:h=480:force_original_aspect_ratio=decrease -r 15 C:/_majordomo/htdocs/cached/img/out1.mp4'); exec('C:\_majordomo\apps\ffmpeg\ffmpeg.exe -y -i "rtsp://10.10.14.12:554/user=admin_password=tlJwpbo6_channel=1_stream=0.sdp?real_stream" -t 10 -f mp4 -vcodec libx264 -pix_fmt yuv420p -an -vf scale=w=640:h=480:force_original_aspect_ratio=decrease -r 15 C:/_majordomo/htdocs/cached/img/out2.mp4'); $img1='C:/_majordomo/htdocs/cached/img/out1.mp4'; $img2='C:/_majordomo/htdocs/cached/img/out2.mp4'; //sleep (3); include_once(DIR_MODULES . 'telegram/telegram.class.php'); $telegram_module = new telegram(); $telegram_module->sendVideoToAll($img1); include_once(DIR_MODULES . 'telegram/telegram.class.php'); $telegram_module = new telegram(); $telegram_module->sendVideoToAll($img2); //Отправка видео в теолеграмм при обнаружении движения // } } // Временно}
Объекты класса:
Свойства класса:
Методы класса:
$volume=round(65535*$params['VALUE']/100); $this->setProperty('volumeLevel',$params['VALUE']); safe_exec('..\\apps\\nircmd\\nircmdc setsysvolume '.$volume); say("Изменилась громкость до ".$params['VALUE']." процентов",2);
Объекты класса:
say("Отключено питание");
$command=$params['command']; $short_command=''; $dt=recognizeTime($command,$short_command); if (preg_match('/Скажи сколько врем/is',$command)) { if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята',2); return; } global $voicemode; $voicemode='on'; say('Сейчас '.timeNow(),2); } elseif (preg_match('/Сколько время/is',$command)) { if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята'); echo $short_command; return; } say('Сейчас '.timeNow()); } elseif (preg_match('/повтори (.+)/is',$command,$m) || preg_match('/скажи (.+)/is',$command,$m)) { if ($dt>0) { addScheduledJob("command".$dt,"processCommand('".$short_command."');",$dt); say('Задача принята',2); return; } global $voicemode; $voicemode='on'; say($m[1],2); } else { say('Неизвестная команда...',2); }
Свойства класса:
Методы класса:
$this->setProperty('LastRun',date('Y-m-d H:i:s'));
$name='Cron_'.$this->object_title; SQLExec("DELETE FROM jobs WHERE title='".$name."'");
Объекты класса:
runScript("Бойлер_потребление");
unlink("C:\backup\backup.tar.gz");
runScript("out_klimat_san");
geturl('http://esp8266:0000@10.10.13.233/pwm?ch=1&set=255&flash=1',0);
geturl('http://esp8266:0000@10.10.13.233/pwm?ch=0&set=150&flash=1',0);
runScript("out_klimat_san");
sg('comp.timetoday', 0);//сбрасываем ежедневное время в 2 ночи
$notified = gg("ESP826600a09cb5.notified"); $notif = 0; if ($notified > 0){ //say('Господа баня нагрелась до 75 градусов',2); //$this->sg('ESP826600a09cb5.notified',1); sg("ESP826600a09cb5.notified",$notif); } //$this->setProperty('notified',1);
include(DIR_MODULES . 'backup/backup.class.php'); $backup_module = new backup(); $backup_module->create_backup($out);
$dir="C:\_majordomo\htdocs\cam\cam1"; //читаем эту директорию $todel=604800; // время на удаление if($OpenDir=opendir($dir)){ while(($file=readdir($OpenDir)) !== false){ if ($file != "." && $file != ".."){ $dtime=intval(time()-filectime("{$dir}/{$file}")); if ($dtime>=$todel) unlink("{$dir}/{$file}"); } } closedir($OpenDir); }
runScript("nagr_pol_v_komnate1");
runScript("nagr_lamp2");
runScript("nagr_lamp3");
runScript("nagr_lamp1"); //runScript("nagr_lamp2"); //runScript("nagr_lamp3"); //runScript("nagr_pol_v_komnate");
SQLExec("DELETE FROM rss_items WHERE TO_DAYS(NOW())-TO_DAYS(ADDED)>3"); //say("Cтарые новости удалены",2);
//getURL('http://10.10.13.227/matrixbr?mode=0', 0); // Яркость дисплея часов setGlobal(AlarmKamEnable,1); //Активирует озвучивание движения с камер
//getURL('http://10.10.13.227/matrixbr?mode=15', 15); //Яркость дисплея часов setGlobal(AlarmKamEnable,1); //Активирует озвучивание движения с камер
runScript("valuta"); // собираем информацию о валюте; //runScript("charge"); //Проверка зарядки телефонов //Погода include_once(DIR_MODULES . 'app_openweather/app_openweather.class.php'); $openweather = new app_openweather(); $openweather->get_weather(gg('ow_city.id')); //Погода //Проверка почтовых отправлений getURL('http://localhost/modules/app_PostTracker/check_track.php',0); //Проверка посылок include_once(DIR_MODULES . 'telegram/telegram.class.php'); $telegram_module = new telegram(); $text="<a href=\"".$params['TRACK_URL']."\">".$params['TRACK']."</a>: ".$params['NAME']; if (isset($params['DISPUTE'])) $text .= "\nИстекает срок доставки! Осталось дней: ".$params['DISPUTE']; else $text .= "\n".$params['DATE']." - ".$params['STATUS']." (".$params['LOCATION'].")"; $content = array('chat_id' => "chat_id", 'text' => $text, 'parse_mode'=>'HTML'); $telegram_module->sendContent($content); //Проверка почтовых отправлений
include_once(DIR_MODULES . 'telegram/telegram.class.php'); $telegram_module = new telegram(); $telegram_module->sendMessageToAll("Алиска перезагружена"); Say("Алиска перезагружена");
$notified = gg('WinterGarden.v10'); $notified8 = gg('WinterGarden.v8'); $on = gg("WinterGarden.on"); if (($notified < 10) and ($on == 1)) { $notified=$notified+1; sg('WinterGarden.v10',$notified); } if (($notified8 < 8) and ($on == 0)) { $notified8=$notified8+1; sg('WinterGarden.v8',$notified8); } //$this->setProperty('notified',1); if (($notified == 10) and ($on == 1)) { sg('WinterGarden.on',0); sg('WinterGarden.v8',0); getURL('http://10.10.13.230/gpio?st=0&pin=4&flash=1',0); //Выключаем освещение } if (($notified8 == 8) and ($on == 0)) { sg('WinterGarden.on',1); sg('WinterGarden.v10',0); getURL('http://10.10.13.230/gpio?st=1&pin=4&flash=1',0); //Включаем освещение }
//playSound('C:\_majordomo\htdocs\cached\AlarmRing\pesnya-pro-musorov.mp3'); playMedia('http://10.10.11.30/cached/AlarmRing/pesnya-pro-musorov.mp3','MAIN'); Say('Готовьте мусор',5);
//playSound('C:\_majordomo\htdocs\cached\AlarmRing\AlarmRing\pesnya-pro-musorov.mp3'); playMedia('http://10.10.11.30/cached/AlarmRing/pesnya-pro-musorov.mp3','MAIN'); Say('Выносите мусор',5);
Свойства класса:
Методы класса:
$val=$this->getProperty("ADC"); $x=0; if ($val<267) { $x=round((1*$val)/267,2); $this->setProperty("ADC_ATM",$x); } if (($val>=267) && ($val<350)) { $x=round((2*$val)/350,2); $this->setProperty("ADC_ATM",$x); } if (($val>=350) && ($val<940)) { $x=round((5*$val)/940,2); $this->setProperty("ADC_ATM",$x); }
$val=$this->getProperty("gpioint2"); if ($val==11) { say('К вам пришли',5); playMedia('http://10.10.11.30/cached/AlarmRing/ktotam.mp3','MAIN'); exec('C:\_majordomo\apps\ffmpeg\ffmpeg -y -i "rtsp://10.10.14.11:554/user=admin_password=tlJwpbo6_channel=1_stream=0.sdp?real_stream" -r 10 -f image2 -ss 00:00:02.500 -vframes 1 c:\doorbell\snapshot.jpeg'); exec('C:\_majordomo\apps\ffmpeg\ffmpeg -y -i "rtsp://10.10.14.13:554/user=admin_password=Rhjccytanm12_channel=1_stream=0.sdp?real_stream" -r 10 -f image2 -ss 00:00:02.500 -vframes 1 c:\doorbell\snapshot1.jpeg'); Sleep(6); playMedia('http://10.10.11.30/cached/AlarmRing/prostokvach.mp3','MAIN'); //sleep(10); //getURL('http://10.10.13.225/gpio?st=0&pin=15',0); //выключить подсветку активности нажатия звонка //$this->setProperty('gpiout15',0); //playMedia('http://10.10.11.30/cached/AlarmRing/prostokvach.mp3','MAIN'); //shell_exec("start C:\\doorbell\\bell.bat"); include_once(DIR_MODULES . 'telegram/telegram.class.php'); $telegram_module = new telegram(); //$telegram_module->sendMessageToAll("К Вам пришли"); $telegram_module->sendImageToAll('C:\doorbell\snapshot.jpeg'); $telegram_module->sendImageToAll('C:\doorbell\snapshot1.jpeg'); }
Объекты класса:
Свойства класса:
Методы класса:
//$params["USER_OBJECT"]
//$params["USER_OBJECT"]
Свойства класса:
Методы класса:
//$params['t'] $this->setProperty("updated",time()); $this->setProperty("updatedTime",date("H:i",time())); $this->setProperty("alive",1); $ot=$this->object_title; $alive_timeout=(int)$this->getProperty("aliveTimeOut"); if (!$alive_timeout) { $alive_timeout=30*60; } clearTimeOut($ot."_alive"); setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout); if (!isset($params['h'])) { return; } $old_temp=$this->getProperty('humidity'); $t=round($params['h'],1); if ($t>100) return; $this->setProperty('humidity',$t); if ($params['uptime']) { $this->setProperty('uptime',$params['uptime']); } if ($t>$old_temp) { $d=1; } elseif ($t<$old_temp) { $d=-1; } else { $d=0; } $this->setProperty('direction',$d); $linked_room=$this->getProperty("LinkedRoom"); if ($linked_room) { setGlobal($linked_room.'.Humidity',$t); }
Объекты класса:
Свойства класса:
Методы класса:
if ($params['status']) { $this->setProperty('status',$params['status']); } $this->setProperty('updatedTimestamp',time()); $this->setProperty("alive",1); $ot=$this->object_title; $alive_timeout=(int)$this->getProperty("aliveTimeOut"); if (!$alive_timeout) { $alive_timeout=12*60*60; } clearTimeOut($ot."_alive"); setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout);
Свойства класса:
Методы класса:
$this->setProperty('status',$params['status']); // выставляем статус сенсора $this->setProperty('updatedTimestamp',time()); // выставляем время срабатывания сенсора $this->setProperty('alive',1); $ot=$this->object_title; $alive_timeout=(int)$this->getProperty("aliveTimeOut"); if (!$alive_timeout) { $alive_timeout=24*60*60; } clearTimeOut($ot."_alive"); setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout); if ($params['status']) { $this->setProperty('motionDetected',1); clearTimeOut($this->object_title.'_detected'); setTimeOut($this->object_title.'_detected',"setGlobal('".$this->object_title.".motionDetected',0);",30); $linked_room=$this->getProperty('LinkedRoom'); if ($linked_room!='') { callMethod($linked_room.'.onActivity'); } if ($this->object_title=='sensorMovement3' || $this->object_title=='sensorMovementRemote1' || $this->object_title=='sensorMovementRemote2') { //|| $this->object_title=='sensorMovement5' return; // не реагируем на движение в спальне, по ip-сенсорам и по сенсору на втром этаже } ClearTimeOut("nobodyHome"); SetTimeOut("nobodyHome","callMethod('NobodyHomeMode.activate');", 1*60*60); // выполняем если целый час никого не было if (getGlobal('NobodyHomeMode.active')) { callMethod('NobodyHomeMode.deactivate'); } $last_register=registeredEventTime('inhouseMovement'); // проверяем когда в последний раз срабатывало событие "движение внутри дома" registerEvent('inhouseMovement',$this->name,2); // регистрируем событие "движение внутри дома" if (timeBetween('05:00', '12:00') && ((time()-$last_register)>2*60*60)) { runScript('Greeting'); // запускаем скрипт "доброе утро" } }
Объекты класса:
Свойства класса:
Объекты класса:
Свойства класса:
Методы класса:
SQLUpdate('objects', array("ID"=>$this->id, "DESCRIPTION"=>$this->getProperty("title").' '.gg('sysdate').' '.gg('timenow')));
Объекты класса:
Свойства класса:
Методы класса:
if($this->getProperty('active')) { $this->callMethod('deactivate'); } else { $this->callMethod('activate'); }
$this->setProperty('active',0);
$this->setProperty('active',1);
$this->setProperty("updated",time()); $this->setProperty("updatedTime",date('H:i')); if ($this->getProperty('active')) { say("Режим ".$this->getProperty('title')." активирован."); } else { say("Режим ".$this->getProperty('title')." выключен."); }
Объекты класса:
setGlobal('minMsgLevel','2'); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nightmode_activate.php'); /* end injection of {SDevices} */
setGlobal('minMsgLevel','1'); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nightmode_deactivate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/darknessmode_activate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/darknessmode_deactivate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nobodyhomemode_activate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/nobodyhomemode_deactivate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/econommode_activate.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/econommode_deactivate.php'); /* end injection of {SDevices} */
Методы класса:
Объекты класса:
include_once(DIR_MODULES.'app_radio/app_radio.class.php'); $app_radio=new app_radio(); if(is_array($params)) { if(isset($params['sta'])) $app_radio->change_station($params['sta'],$app_radio); if(isset($params['cmd'])) $app_radio->control($params['cmd']); if(isset($params['vol'])) $app_radio->set_volume($params['vol'],$app_radio); } else { if($params=='play' || $params=='stop') $app_radio->control($params); else if(strpos($params, "vol")===0) $app_radio->set_volume((int)substr($params,3),$app_radio); else if(strpos($params, "sta:")===0) $app_radio->change_station(substr($params,4),$app_radio); } /* begin injection of {app_radio} */ include_once(DIR_MODULES.'app_radio/app_radio.class.php'); $app_radio = new app_radio(); if(is_array($params)) { foreach($params as $key=>$value) { switch((string)$key) { case 'sta': $app_radio->change_station($params['sta'], $app_radio); break; case 'cmd': $app_radio->control($params['cmd']); break; case 'vol': $app_radio->set_volume($params['vol'], $app_radio); break; default: if($value == 'play' || $value == 'stop') $app_radio->control($value); elseif(strpos($value, 'vol') === 0) $app_radio->set_volume((int)substr($value, 3), $app_radio); elseif(strpos($value, 'sta:') === 0) $app_radio->change_station(substr($value, 4), $app_radio); } } } /* end injection of {app_radio} */
Свойства класса:
Методы класса:
$status=$this->getProperty("status"); if ($status) { $this->callMethod('turnOff'); } else { $this->callMethod('turnOn'); }
$this->setProperty("status",0);
$this->setProperty("status",1);
$status=$this->getProperty("status"); if ($status) { $this->callMethod('turnOn'); } else { $this->callMethod('turnOff'); }
Объекты класса:
Свойства класса:
Методы класса:
$this->setProperty("status",1); $this->callMethod("sendCommand",array('command'=>'-on_ch'.$this->getProperty("channel")));
$this->setProperty("status",0); //safe_exec('"c:\Program Files\nooLite\noolite.exe" -api -off_ch'.$this->getProperty("channel")); $this->callMethod("sendCommand",array('command'=>'-off_ch'.$this->getProperty("channel")));
$cmdline='"c:\Program Files\nooLite\nooLite.exe" -api '.$params['command']; $last_called=gg('NoolightCommandSend'); $min_delay=3; $now=time(); if (($now-$last_called)>$min_delay) { //safe_exec($cmdline); $last_callled=$now; sg('NoolightCommandSend',$last_called); DebMes("Noolite instant exec: ".$cmdline); system($cmdline); //exec($cmdline); } else { if ($last_callled<$now) { $last_callled=$now; } $last_called+=$min_delay; sg('NoolightCommandSend',$last_called); DebMes("Noolite scheduled job for ".date('H:i:s',$last_called)); AddScheduledJob("noolight".md5($cmdline),"safe_exec('".$cmdline."');",$last_called); }
Свойства класса:
Методы класса:
$code1=$this->getProperty('Code1'); $code2=$this->getProperty('Code2'); safe_exec("c:\_majordomo\apps\arduino_gw\arduino_gw.exe rcon$code1:$code2;"); $this->setProperty("status",1);
$code1=$this->getProperty('Code1'); $code2=$this->getProperty('Code2'); safe_exec("c:\_majordomo\apps\arduino_gw\arduino_gw.exe rcoff$code1:$code2;"); $this->setProperty("status",0);
Свойства класса:
Методы класса:
$rooms=getObjectsByClass("Rooms"); $total=count($rooms); for($i=0;$i<$total;$i++) { $rooms[$i]['room']=getGlobal($rooms[$i]['TITLE'].'.Title'); if (!$rooms[$i]['room']) { $rooms[$i]['room']=$rooms[$i]['TITLE']; } $rooms[$i]['active']=getGlobal($rooms[$i]['TITLE'].'.SomebodyHere'); $rooms[$i]['time']=getGlobal($rooms[$i]['TITLE'].'.LatestActivity'); $rooms[$i]['diff']=time()-$rooms[$i]['time']; } function cmp($a, $b) { if ($a['diff'] == $b['diff']) { return 0; } return ($a['diff'] < $b['diff']) ? -1 : 1; } usort($rooms,"cmp"); if (!$rooms[0]['active']) { $somebodyHomeText="Никого нет дома. Были в ".date('H:i',$rooms[0]['time'])." (".$rooms[0]['room'].")"; } else { $res_rooms=array(); for($i=0;$i<$total;$i++) { if ($rooms[$i]['active']) { $res_rooms[]=$rooms[$i]['room']; } } $somebodyHomeText="Кто-то дома: ".implode(", ",$res_rooms); } setGlobal('somebodyHomeText',$somebodyHomeText); //echo "Updated"; /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_updateActivityStatus.php'); /* end injection of {SDevices} */
$this->setProperty('SomebodyHere',0); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_onIdle.php'); /* end injection of {SDevices} */
$latestActivity=$this->getProperty('LatestActivity'); $this->setProperty('LatestActivity',time()); $this->setProperty('LatestActivityTime',date('H:i')); $this->setProperty('SomebodyHere',1); $ot=$this->object_title; if ($this->getProperty("IdleDelay")) { $activity_timeout=(int)$this->getProperty("IdleDelay"); } else { $activity_timeout=10*60; } clearTimeOut($ot."_activity_timeout"); setTimeOut($ot."_activity_timeout","callMethod('".$ot.".onIdle');",$activity_timeout); $this->callMethod("updateActivityStatus"); /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/Rooms_onActivity.php'); /* end injection of {SDevices} */
Объекты класса:
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_batteryLevelUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_keepAlive.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDevices_setUpdatedText.php'); /* end injection of {SDevices} */
require(DIR_MODULES.'devices/SDevices_statusUpdated.php');
require(DIR_MODULES.'devices/SDevices_logicAction.php');
Свойства класса:
Методы класса:
require(DIR_MODULES.'devices/SButtons_pressed.php');
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCameras_takeSeries.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCameras_motionDetected.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCameras_updatePreview.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCameras_takeSnapshot.php'); /* end injection of {SDevices} */
Объекты класса:
Свойства класса:
Методы класса:
require(DIR_MODULES.'devices/SControllers_turnOn.php');
require(DIR_MODULES.'devices/SControllers_turnOff.php');
require(DIR_MODULES.'devices/SControllers_switch.php');
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_valueUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_setTargetTemperature.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_setThermostatMode.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_setFanSpeedMode.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_configUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_fanSpeedUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_thermostatUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_tempUp.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SAirConditioners_tempDown.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_startLevelUp.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_startLevelDown.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_stopLevelMove.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_setLevel.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SDimmers_levelWorkUpdated.php'); /* end injection of {SDevices} */
require(DIR_MODULES.'devices/SDimmers_turnOff.php');
require(DIR_MODULES.'devices/SDimmers_turnOn.php');
require(DIR_MODULES.'devices/SDimmers_levelUpdated.php');
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroups_statusUpdated.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMedias_pause.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMedias_setSource.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMedias_setVolume.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMedias_setChannel.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_setColor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SRGB_colorUpdated.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_relay_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_checkWindows.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_setTargetTemperature.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_switchEnable.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_enable.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_disable.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_turnOn.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_turnOff.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_tempUp.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_tempDown.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_valueUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SThermostats_statusUpdated.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STVs_setVolume.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STVs_setChannel.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STVs_setSource.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STVs_pause.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCounters_valueWorkUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCounters_refreshStats.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCounters_valueUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SCounters_pulseDetected.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroupStates_restore.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SGroupStates_save.php'); /* end injection of {SDevices} */
Свойства класса:
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLeak_unblockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLeak_blockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLeak_alert.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLeak_statusUpdated.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMotions_blockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SMotions_unblockSensor.php'); /* end injection of {SDevices} */
require(DIR_MODULES.'devices/SMotions_motionDetected.php');
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenable_levelUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenable_statusUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenable_switch.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenable_open.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenable_close.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenable_setLevel.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenClose_blockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SOpenClose_unblockSensor.php'); /* end injection of {SDevices} */
require(DIR_MODULES.'devices/SOpenClose_statusUpdated.php');
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSensors_alert.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSensors_blockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSensors_unblockSensor.php'); /* end injection of {SDevices} */
require(DIR_MODULES.'devices/SSensors_valueUpdated.php');
Свойства класса:
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLightSensors_valueUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SLightSensors_periodMinValueUpdated.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SPowerSensors_valueUpdated.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SPowerSensors_loadStatusChanged.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/STempHumSensors_valueUpdated.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSmoke_alert.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSmoke_unblockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSmoke_blockSensor.php'); /* end injection of {SDevices} */
/* begin injection of {SDevices} */ require(DIR_MODULES.'devices/SSmoke_statusUpdated.php'); /* end injection of {SDevices} */
Свойства класса:
Методы класса:
Объекты класса:
echo "status received: ".$params['status'];
global $voicemode; $voicemode='off'; processCommand($params['message']);
Свойства класса:
Методы класса:
SQLUpdate("objects", array("ID"=>$this->id, "DESCRIPTION"=>gg("sysdate")." ".gg("timenow")));
Объекты класса:
Свойства класса:
Методы класса:
Объекты класса:
$details=array(); $red_state=0; $yellow_state=0; if (!isOnline('Internet')) { $yellow_state=1; $details[]=LANG_GENERAL_NO_INTERNET_ACCESS; } if ($red_state) { $state='red'; $state_title=LANG_GENERAL_RED; } elseif ($yellow_state) { $state='yellow'; $state_title=LANG_GENERAL_YELLOW; } else { $state='green'; $state_title=LANG_GENERAL_GREEN; } $new_details=implode(". ",$details); if ($this->getProperty("stateDetails")!=$new_details) { $this->setProperty('stateDetails',$new_details); } if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say(LANG_GENERAL_COMMUNICATION_STATE." ".LANG_GENERAL_CHANGED_TO." ".$state_title."."); say(implode(". ",$details)); } else { say(LANG_GENERAL_COMMUNICATION_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title); } $this->callMethod('stateChanged'); }
$details=array(); $red_state=0; $yellow_state=0; $cycles=array('states'=>'states','main'=>'main','execs'=>'exec','scheduler'=>'scheduler'); foreach($cycles as $k=>$v) { $tm=getGlobal('ThisComputer.cycle_'.$k.'Run'); if (time()-$tm>5*60) { $red_state=1; $details[]=$v." ".LANG_GENERAL_CYCLE." ".LANG_GENERAL_STOPPED."."; } } $cycles=array('ping'=>'ping','webvars'=>'webvars'); foreach($cycles as $k=>$v) { $tm=getGlobal('ThisComputer.cycle_'.$k.'Run'); if (time()-$tm>10*60) { $yellow_state=1; $details[]=$v." ".LANG_GENERAL_CYCLE." ".LANG_GENERAL_STOPPED."."; } } if ($red_state) { $state='red'; $state_title=LANG_GENERAL_RED; } elseif ($yellow_state) { $state='yellow'; $state_title=LANG_GENERAL_YELLOW; } else { $state='green'; $state_title=LANG_GENERAL_GREEN; } $new_details=implode(". ",$details); if ($this->getProperty("stateDetails")!=$new_details) { $this->setProperty('stateDetails',$new_details); } if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say(LANG_GENERAL_SYSTEM_STATE." ".LANG_GENERAL_CHANGED_TO." ".$state_title."."); say(implode(". ",$details)); } else { say(LANG_GENERAL_SYSTEM_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title); } $this->callMethod('stateChanged'); } /* begin injection of {SDevices} */ require(DIR_MODULES.'devices/system_checkstate.php'); /* end injection of {SDevices} */
$details=array(); $red_state=0; $yellow_state=0; if ($red_state) { $state='red'; $state_title=LANG_GENERAL_RED; } elseif ($yellow_state) { $state='yellow'; $state_title=LANG_GENERAL_YELLOW; } else { $state='green'; $state_title=LANG_GENERAL_GREEN; } $new_details=implode(". ",$details); if ($this->getProperty("stateDetails")!=$new_details) { $this->setProperty('stateDetails',$new_details); } if ($this->getProperty('stateColor')!=$state) { $this->setProperty('stateColor',$state); $this->setProperty('stateTitle',$state_title); if ($state!='green') { say(LANG_GENERAL_SECURITY_STATE." ".LANG_GENERAL_CHANGED_TO." ".$state_title."."); say(implode(". ",$details)); } else { say(LANG_GENERAL_SECURITY_STATE." ".LANG_GENERAL_RESTORED_TO." ".$state_title); } $this->callMethod('stateChanged'); }
Свойства класса:
Методы класса:
//$params['t'] $this->setProperty("updated",time()); $this->setProperty("updatedTime",date("H:i",time())); $this->setProperty("alive",1); $ot=$this->object_title; $alive_timeout=(int)$this->getProperty("aliveTimeOut"); if (!$alive_timeout) { $alive_timeout=30*60; } clearTimeOut($ot."_alive"); setTimeOut($ot."_alive","sg('".$ot.".alive',0);",$alive_timeout); if (!isset($params['t'])) { return; } $old_temp=$this->getProperty('temp'); $t=round($params['t'],1); if ($t>110) return; $this->setProperty('temp',$t); if ($params['uptime']) { $this->setProperty('uptime',$params['uptime']); } if ($t>$old_temp) { $d=1; } elseif ($t<$old_temp) { $d=-1; } else { $d=0; } $this->setProperty('direction',$d); $linked_room=$this->getProperty("LinkedRoom"); if ($linked_room) { setGlobal($linked_room.'.Temperature',$t); }
Объекты класса:
Свойства класса:
Методы класса:
say('1',1); $gpioint2 = getProperty('gpioint2'); if ($gpioint2 == 0) { $this->setProperty('gpiout2-invers',1); } if ($gpioint2 == 1) { $this->setProperty('gpiout2-invers',0); }
Объекты класса:
Свойства класса:
Методы класса:
Объекты класса:
$h=(int)date('G',time()); $m=date('i',time()); if (isWeekDay()) { } //расскладываем время на часы и минуты для планшета $timeH=date("H", time()); $timeM=date("i", time()); sg("ThisComputer.timeH",$timeH); sg("ThisComputer.timeM",$timeM); if (($h>=8) && getGlobal('clockChimeEnabled')) { if ($m=="00") { //say(timeNow(),1); say(timeNow(),2); } if ($m=="10") { //Погода openweather //include_once(DIR_MODULES . 'app_openweather/app_openweather.class.php'); //$openweather = new app_openweather(); //$openweather->get_weather(gg('ow_city.id')); //Погода openweather //Проверка посылок //require_once(DIR_MODULES . '/app_PostTracker/app_PostTracker.class.php'); //$PostTracker = new app_PostTracker(); //$PostTracker->updateStatuses(); //Проверка посылок // getURL('http://localhost/modules/app_PostTracker/check_track.php',0); /* $params['NAME'] - name parcel $params['TRACK'] - track number $params['TRACK_URL'] - track url $params['DATE'] - datetime last status $params['STATUS'] - last status $params['DISPUTE'] - day to dispute $params['LOCATION'] - location */ //Проверка посылок } } setGlobal('timeNow',date('H:i')); $homeStatus=date('H:i'); if (getGlobal('NobodyHomeMode.active')) { $homeStatus.=' Дома никого'; } else { $homeStatus.=' Дома кто-то есть'; } $homeStatus.=' '.getGlobal('Security.stateDetails'); $homeStatus.=' '.getGlobal('System.stateDetails'); $homeStatus.=' '.getGlobal('Communication.stateDetails'); setGlobal('HomeStatus',$homeStatus); if (timeBetween(getGlobal('SunRiseTime'),getGlobal('SunSetTime')) && getGlobal('isDark')=="1") { setGlobal("isDark",0); callMethod('DarknessMode.deactivate'); } elseif (!timeBetween(getGlobal('SunRiseTime'),getGlobal('SunSetTime')) && getGlobal('isDark')!="1") { setGlobal("isDark",1); callMethod('DarknessMode.activate'); } if (timeIs(getGlobal('SunRiseTime'))) { say('Всходит солнце'); } if (timeIs(getGlobal('SunSetTime'))) { say('Солнце заходит',2); } if (timeIs("23:30") && (gg("EconomMode.active")!="1") && (gg("NobodyHomeMode.active")=="1")) { say("Похоже никого нет сегодня, можно сэкономить немного."); callMethod('EconomMode.activate'); } if (timeIs('20:00')) { //callMethod('NightMode.activate'); //getURL('http://10.10.13.227/matrixbr?mode=0', 0); // Яркость дисплея часов } elseif (timeIs('08:00')) { callMethod('NightMode.deactivate'); //getURL('http://10.10.13.227/matrixbr?mode=15', 15); //Яркость дисплея часов } if (timeIs("03:00")) { //runScript("systemMaintenance"); Сделал запуск из модуля crone } //сарый будильник, сейчас отключен. //if (timeIs(gg('ThisComputer.AlarmTime'))) { //runScript('MorningAlarm'); //say('Это будильник',2); //} //старый будильник, сейчас отключен. //будильник //include_once(DIR_MODULES."app_alarmclock/app_alarmclock.class.php"); //$app_alarmclock=new app_alarmclock(); //$app_alarmclock->check_alarm(); //будильник //Выключение компов if (date('H:i')=='00:00') { sg('comp.timetoday', 0);//сбрасываем ежедневное время в 12 ночи } if (gg('comp.online')) { sg('comp.timetoday', gg('comp.timetoday')+1); //прибавляем 1 мин к времени работы, если комп включен } if (gg('comp.timetoday')>gg('comp.timelimit')) { //cm('comp.turnoff'); //запускаем метод на выключение, если время за сегодня больше лимита shell_exec("start C:\\reboot\\shutdown.bat"); //скрипт на выключение компа } //Выключение компов //Новое для алертов pushbullet //Проверяем датчики //if (($m=="05")||($m=="20")||($m=="35")||($m=="50")) { //if ($params['Value'] > getProperty('ValueMIN')) { //$this->setProperty('ValueActual',1); //} //else //{ //$this->setProperty('ValueActual',0); //} //$this->setProperty('updatedTimestamp',time()); //Новое для алертов pushbullet //} //Проверяем лигитимно ли включен компьютер //if (($m=="00") || ($m=="05") || ($m=="10") || ($m=="15") || ($m=="20") || ($m=="25") || ($m=="30") || ($m=="35") || ($m=="40") || ($m=="45") || ($m=="50") || ($m=="55")) { //if (timeBetween(gg('ThisComputer.computer_on'),gg('ThisComputer.computer_off'))) { //} //else //{ //say('Выключаю компьютер Валеры',2); //shell_exec("start C:\\reboot\\shutdown.bat"); //} //} //Проверяем лигитимно ли включен компьютер
Свойства класса:
Методы класса:
// МЕТОД check $todo = $this->getProperty("todo"); // установим внутреннюю кодировку символов mb_internal_encoding("UTF-8"); $td = explode("|", $todo); if (isset($params["task"])) { $ct = $params["task"]; for($i = 0; ($i < sizeof($td)); $i++) { // выделим и сохраним первый символ $check = mb_substr($td[$i], 0, 1); // обрежем строку, не будем отображать первый символ + или - $task = mb_substr($td[$i], 1); // если совпадает номер строки if ($i == $ct) { // инвентируем check $check = ($check == "+") ? "-" : "+"; $tcheck = ($check == "+") ? ""выполненно"" : ""не выполнено""; $sayTodo = gg("Sets.sayTodo"); if ($sayTodo) { say ("Todo задача: "".$task."" - отмечена как ".$tcheck,($sayTodo-2)); } } $td[$i] = $check.$task; } $todo = implode("|", $td); $this->setProperty("todo", $todo); } // выполним подготовку для отображения // callMethod("TodoList.view");
// МЕТОД delete $todo = $this->getProperty("todo"); $dt = $params["task"]; // получаем номер строки на удаление $td = explode("|", $todo); // Считываем всё в массив for($i = 0; $i < sizeof($td); $i++) { if($i == $dt) { $sayTodo = gg("Sets.sayTodo"); if ($sayTodo) { say ("Из листа todo удалена задача: "".mb_substr($td[$i], 1).""",($sayTodo-2)); } unset($td[$i]); } } $todo = implode("|", $td); $this->setProperty("todo", $todo); // выполним подготовку для отображения // callMethod("TodoList.view");
// МЕТОД view - подготовка кода для отображения $todo = $this->getProperty("todo"); // установим внутреннюю кодировку символов mb_internal_encoding("UTF-8"); $td = explode("|", $todo); $str_cod = '<div id="list"> <div class="new"> <input id="newtask" placeholder="New Item" type="text"> <button onClick="btnRunClicked();" class="fa fa-plus"></button> </div> <div class="list">'; for($i = 1; $i < sizeof($td); $i++) { // выделим и сохраним первый символ $check = mb_substr($td[$i], 0, 1); // обрежем строку, не будем отображать первый символ + или - $task = mb_substr($td[$i], 1); // начинаем формировать код hsl(196,'.(73-24*(($i-1)%2)).'%,50%) $str_cod = $str_cod.' <div class="item" id="taskbox_'.$i.'" style ="background: hsl('.(190+$i*6).',73%,50%);"> <span id="task_'.$i.'"'; // если певый символ "+" то значит задание "выполнено" if ($check == "+") { $str_cod = $str_cod.' class="checked"'; } $str_cod = $str_cod.'>'.$task.'</span>'; $str_cod = $str_cod.' <div class="rightblock"> <button id="check_'.$i.'" class="check fa fa-check" onClick="checkClicked('.$i.');"></button> <button id="delete_'.$i.'" class="delete fa fa-times" onClick="deleteClicked('.$i.');"></button> </div> </div>'; } $str_cod = $str_cod.' </div> </div>'; // записываем получившийся код $this->setProperty("StreamingCodeScene",$str_cod); $str_cod_css = "<style>".$this->getProperty("menuCSS")."</style>"; $str_cod_js = "<script type='text/javascript'>".$this->getProperty("JS")."</script>"; $str_cod = $str_cod_css.$str_cod_js.$str_cod; $this->setProperty("StreamingCodeMenu",$str_cod);
// МЕТОД new if (isset($params["task"])) { $todo = $this->getProperty("todo"); $mytask = "-".$params["task"]; // строка задачи $sayTodo = gg("Sets.sayTodo"); if ($sayTodo) { say ("В лист todo добавлена задача: "".$params["task"].""",($sayTodo-2)); } $todo = $todo."|".$mytask; // добавляем с разделителем $this->setProperty("todo", $todo); }
Объекты класса:
// ****************************************************************** // * TO DO app - by Vovix - 30.11.2015 г. - v 3.1 * // ****************************************************************** // создадим класс и объекты addClass('ToDo'); addClassObject('ToDo','TodoList'); addClassProperty('ToDo','StreamingCodeMenu'); // HTML для меню addClassProperty('ToDo','StreamingCodeScene'); // HTML для сцен addClassProperty('ToDo','menuCSS'); // CSS для меню addClassProperty('ToDo','sceneCSS'); // CSS для сцены addClassProperty('ToDo','JS'); // общий код javascript addClassProperty('ToDo','todo'); // сам лист to do // $this->setProperty('todo', '- to do list by Vovix -'); $menuCSS=' @import url("https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"); #item194 { /* здесь item194 - это номер ID пункта меню в котором он размещен */ padding: 0; } #list { position: relative; /* width: calc(100% + 40px); */ /* margin: 0 -20px 0 -20px; */ width: 100%; margin: 0; } #list .new { width: 100%; height: 50px; padding: 0; margin: 0; } #list .new #newtask { float: left; width: calc(100% - 76px); height: 50px; padding: 0; margin: 0; background: #333333; text-indent: 8px; } #list .new input { font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 14px; color: #FFF; text-align: justify; line-height: normal; outline: 0; border: 0; border-radius: 0px; text-shadow: none; } #list .new #newtask::-webkit-input-placeholder { color: rgba(255, 255, 255, 0.5); } #list .new button { cursor: pointer; float: right; width: 76px; height: 50px; padding: 0; outline: 0; border: 0; border-radius: 0px; margin: -9px 0 0 0; background: #111111; font-size: 24px; color: #FFF; } #list .list .item { clear: both; width: 100%; height: 38px; margin: 0; } #list .list .item span { cursor: default; float: left; width: calc(100% - 76px); height: 20px; padding: 9px 0 0 0; margin: 0; outline: 0; border: 0; background: transparent; text-indent: 8px; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 14px; color: #FFF; text-align: justify; text-shadow: none; } #list .list .item span.checked { opacity: .5; text-decoration: line-through; } #list .list .item .rightblock { float: right; width: 76px; height: 38px; padding: 0; margin: 0; } #list .list .item .rightblock button { cursor: pointer; float: left; width: 38px; height: 38px; padding: 0px; margin: 0; outline: 0; border: 0; border-radius: 0px; background: rgba(0,0,0,0.1); font-size: 20px; color: #FFF; } '; $this->setProperty('menuCSS', $menuCSS); $sceneCSS=' #list { position: relative; width: 100%; max-height: 528px; overflow: auto; margin: 0; } #list .new #newtask { float: left; width: calc(100% - 100px); height: 100px; padding: 0; margin: 0; outline: 0; border: 0; background: #333333; line-height: 50px; text-indent: 25px; } #list .new input { font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 28px; color: #FFF; text-align: justify; line-height: normal; outline: 0; border: 0; border-radius: 0px; text-shadow: 0px; } #list .new #newtask::-webkit-input-placeholder { color: rgba(255, 255, 255, 0.5); } #list .new button { cursor: pointer; float: right; width: 100px; height: 100px; padding: 0; margin: 0; outline: 0; border: 0; border-radius: 0px; background: #111111; font-size: 84px; color: #FFF; } #list .list .item { clear: both; width: 100%; height: 50px; margin: 0; padding: 5px 0 0 0; } #list .list .item span { cursor: default; float: left; width: calc(100% - 150px); height: 50px; padding: 0; margin: 0; outline: 0; border: 0; background: transparent; text-indent: 25px; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 28px; color: #FFF; text-align: justify; line-height: normal; } #list .list .item span.checked { opacity: .5; text-decoration: line-through; } #list .list .item .rightblock { float: right; padding: 0; margin: -2px 0 0 0; } #list .list .item button{ cursor: pointer; float: left; width: 50px; height: 50px; padding: 0; margin: 0; outline: 0; border: 0; box-shadow: 0 0 3px rgba(0,0,0,0.2); background: rgba(0,0,0,0.1); font-size: 32px; color: #FFF; } '; $this->setProperty('sceneCSS', $sceneCSS); $JS=' function btnRunClicked() { var newtask = $("#newtask").val(), ni = $("div.item").length + 1; $("#newtask").val(""); if (newtask) { var task1 = String(newtask); var codItem1 = \'<div class="item" id="taskbox_\' + ni + \'" style ="background: hsl(\' + (190+ni*6) + \',73%,50%);">\'; var codItem2 = \'<span id="task_\' + ni + \'">\' + task1 + \'</span>\'; var codItem3 = \'<div class="rightblock"><button id="check_\' + ni + \'" class="check fa fa-check ui-btn ui-shadow ui-corner-all" onClick="checkClicked(\' + ni +\');"></button>\'; var codItem4 = \'<button id="delete_\' + ni + \'" class="delete fa fa-times ui-btn ui-shadow ui-corner-all" onClick="deleteClicked(\' + ni + \');"></button></div></div>\'; $.get( "/objects/", { object:"TodoList", op:"m", m:"new", task:newtask } ); setTimeout(function() { $.get( "/objects/", { object:"TodoList", op:"m", m:"view" } ) }, 100); $(codItem1 + codItem2 + codItem3 + codItem4).appendTo("div.list"); return false; } } function checkClicked(ctask) { if (ctask) { $.get( "/objects/", { object:"TodoList", op:"m",m:"check", task:ctask } ); $("#task_"+ctask).toggleClass("checked"); setTimeout(function() { $.get( "/objects/", { object:"TodoList", op:"m", m:"view" } ) }, 100); return false; } } function deleteClicked(dtask) { if (dtask) { $.get( "/objects/", { object:"TodoList", op:"m", m:"delete", task:dtask } ); $("#taskbox_"+dtask).remove(); setTimeout(function() { $.get( "/objects/", { object:"TodoList", op:"m", m:"view" } ) }, 100); return false; } } '; $this->setProperty('JS', $JS); $view=' // МЕТОД view - подготовка кода для отображения $todo = $this->getProperty("todo"); // установим внутреннюю кодировку символов mb_internal_encoding("UTF-8"); $td = explode("|", $todo); $str_cod = \'<div id="list"> <div class="new"> <input id="newtask" placeholder="New Item" type="text"> <button onClick="btnRunClicked();" class="fa fa-plus"></button> </div> <div class="list">\'; for($i = 1; $i < sizeof($td); $i++) { // выделим и сохраним первый символ $check = mb_substr($td[$i], 0, 1); // обрежем строку, не будем отображать первый символ + или - $task = mb_substr($td[$i], 1); // начинаем формировать код hsl(196,\'.(73-24*(($i-1)%2)).\'%,50%) $str_cod = $str_cod.\' <div class="item" id="taskbox_\'.$i.\'" style ="background: hsl(\'.(190+$i*6).\',73%,50%);"> <span id="task_\'.$i.\'"\'; // если певый символ "+" то значит задание "выполнено" if ($check == "+") { $str_cod = $str_cod.\' class="checked"\'; } $str_cod = $str_cod.\'>\'.$task.\'</span>\'; $str_cod = $str_cod.\' <div class="rightblock"> <button id="check_\'.$i.\'" class="check fa fa-check" onClick="checkClicked(\'.$i.\');"></button> <button id="delete_\'.$i.\'" class="delete fa fa-times" onClick="deleteClicked(\'.$i.\');"></button> </div> </div>\'; } $str_cod = $str_cod.\' </div> </div>\'; // записываем получившийся код $this->setProperty("StreamingCodeScene",$str_cod); $str_cod_css = "<style>".$this->getProperty("menuCSS")."</style>"; $str_cod_js = "<script type=\'text/javascript\'>".$this->getProperty("JS")."</script>"; $str_cod = $str_cod_css.$str_cod_js.$str_cod; $this->setProperty("StreamingCodeMenu",$str_cod); '; addClassMethod('ToDo', 'view', $view); $check=' // МЕТОД check $todo = $this->getProperty("todo"); // установим внутреннюю кодировку символов mb_internal_encoding("UTF-8"); $td = explode("|", $todo); if (isset($params["task"])) { $ct = $params["task"]; for($i = 0; ($i < sizeof($td)); $i++) { // выделим и сохраним первый символ $check = mb_substr($td[$i], 0, 1); // обрежем строку, не будем отображать первый символ + или - $task = mb_substr($td[$i], 1); // если совпадает номер строки if ($i == $ct) { // инвентируем check $check = ($check == "+") ? "-" : "+"; $tcheck = ($check == "+") ? ""выполненно"" : ""не выполнено""; $sayTodo = gg("Sets.sayTodo"); if ($sayTodo) { say ("Todo задача: "".$task."" - отмечена как ".$tcheck,($sayTodo-2)); } } $td[$i] = $check.$task; } $todo = implode("|", $td); $this->setProperty("todo", $todo); } // выполним подготовку для отображения // callMethod("TodoList.view"); '; addClassMethod('ToDo', 'check', $check); $delete = ' // МЕТОД delete $todo = $this->getProperty("todo"); $dt = $params["task"]; // получаем номер строки на удаление $td = explode("|", $todo); // Считываем всё в массив for($i = 0; $i < sizeof($td); $i++) { if($i == $dt) { $sayTodo = gg("Sets.sayTodo"); if ($sayTodo) { say ("Из листа todo удалена задача: "".mb_substr($td[$i], 1).""",($sayTodo-2)); } unset($td[$i]); } } $todo = implode("|", $td); $this->setProperty("todo", $todo); // выполним подготовку для отображения // callMethod("TodoList.view"); '; addClassMethod('ToDo', 'delete', $delete); $new = ' // МЕТОД new if (isset($params["task"])) { $todo = $this->getProperty("todo"); $mytask = "-".$params["task"]; // строка задачи $sayTodo = gg("Sets.sayTodo"); if ($sayTodo) { say ("В лист todo добавлена задача: "".$params["task"].""",($sayTodo-2)); } $todo = $todo."|".$mytask; // добавляем с разделителем $this->setProperty("todo", $todo); } '; addClassMethod('ToDo', 'new', $new); callMethod("TodoList.view");
Свойства класса:
Методы класса:
Методы класса:
Объекты класса:
if ($params['serial']=='' && $params['devname']!='') { $params['serial']=$params['devname']; } $device=SQLSelectOne("SELECT * FROM usbdevices WHERE SERIAL LIKE '".$params['serial']."'"); if (!$device['ID']) { // new device connected //say("Подключено новое устройство",1); $device=array(); $device['SERIAL']=$params['serial']; $device['TITLE']='устройство '.$params['devname']; $device['FIRST_FOUND']=date('Y-m-d H:i:s'); $device['LAST_FOUND']=date('Y-m-d H:i:s'); $device['LOG'].=$device['FIRST_FOUND'].' подключено (впервые)'."\n"; $device['ID']=SQLInsert('usbdevices',$device); } else { // device already in our database //say("Подключено ".$device['TITLE'],1); if ($device['USER_ID']) { $user=SQLSelectOne("SELECT * FROM users WHERE ID='".$device['USER_ID']."'"); if ($user['ID']) { //$user['NAME']; // теперь мы знаем имя пользователя, связанного с этим устройством } } $device['LAST_FOUND']=date('Y-m-d H:i:s'); $device['LOG']=$device['LAST_FOUND'].' подключено'."\n".$device['LOG']; SQLUpdate('usbdevices',$device); if ($device['SCRIPT_ID']!='') { runScript($device['SCRIPT_ID'],$params); } elseif ($device['SCRIPT']!='') { eval($device['SCRIPT']); } } say("Подключено ".$device['TITLE'],1);
Свойства класса:
Методы класса:
//$params["LOCATION_OBJECT"], $params["LOCATION"]
//$params["LOCATION_OBJECT"], $params["LOCATION"]
Объекты класса:
Свойства класса:
Объекты класса:
Свойства класса:
Методы класса:
include_once(DIR_MODULES . "yandexweather/yandexweather.class.php"); $yw = new yandexweather(); $yw->sayforecast();
include_once(DIR_MODULES . "yandexweather/yandexweather.class.php"); $yw = new yandexweather(); $yw->sayweather();
require(DIR_MODULES."yandexweather/changetemp.php");
$sqlQuery = "SELECT pvalues.*, objects.TITLE as OBJECT_TITLE, properties.TITLE as PROPERTY_TITLE FROM pvalues JOIN objects ON pvalues.OBJECT_ID = objects.id JOIN properties ON pvalues.PROPERTY_ID = properties.id WHERE pvalues.PROPERTY_NAME != CONCAT_WS('.', objects.TITLE, properties.TITLE)"; $data = SQLSelect($sqlQuery); $total = count($data); for ($i = 0; $i < $total; $i++) { $objectProperty = $data[$i]["OBJECT_TITLE"] . "." . $data[$i]["PROPERTY_TITLE"]; $sqlQuery = "SELECT * FROM pvalues WHERE ID =".$data[$i]['ID'] ; $rec = SQLSelectOne($sqlQuery); $rec['PROPERTY_NAME'] = $data[$i]["OBJECT_TITLE"] . "." . $data[$i]["PROPERTY_TITLE"]; SQLUpdate("pvalues", $rec); } $data = SQLSelect($sqlQuery); $total = count($data); for ($i = 0; $i < $total; $i++) { $objectProperty = $data[$i]["OBJECT_TITLE"] . "." . $data[$i]["PROPERTY_TITLE"]; $sqlQuery = "SELECT * FROM pvalues WHERE ID =".$data[$i]["ID"] ; $rec = SQLSelectOne($sqlQuery); $rec["PROPERTY_NAME"] = $data[$i]["OBJECT_TITLE"] . "." . $data[$i]["PROPERTY_TITLE"]; SQLUpdate("pvalues", $rec); }
SQLUpdate("objects", array("ID"=>$this->id, "DESCRIPTION"=>gg("sysdate")." ".gg("timenow")));
///
Объекты класса:
if(($this->object_title=="yw_mycity") and ($this->getProperty("condition")<>"")) { //require(DIR_MODULES."yandexweather/ywext.inc.php"); include_once(DIR_MODULES."yandexweather/ywext.inc.php"); $lastcondition=gg("yw_mycity.lastcondition"); $conditioneng=gg("yw_mycity.condition"); $condition1eng=gg("yw_mycity.forecast_0_daycondition"); $condition2eng=gg("yw_mycity.forecast_1_daycondition"); $condition3eng=gg("yw_mycity.forecast_2_daycondition"); $condition=getconditionrusincl($conditioneng); $condition1=getconditionrusincl($condition1eng); $condition2=getconditionrusincl($condition2eng); $condition3=getconditionrusincl($condition3eng); sg("yw_mycity.conditionrus",$condition); sg("yw_mycity.condition1rus",$condition1) ; sg("yw_mycity.condition2rus",$condition2) ; sg("yw_mycity.condition3rus",$condition3) ; $cmd_rec = SQLSelectOne("SELECT VALUE FROM yaweather_config where parametr='ENABLE_EVENTS'"); $ee=$cmd_rec['VALUE']; $cmd_rec = SQLSelectOne("SELECT VALUE FROM yaweather_config where parametr='MSG_LEVEL'"); $msglevel=$cmd_rec['VALUE']; $cmd_rec = SQLSelectOne("SELECT VALUE FROM yaweather_config where parametr='LASTCONDITION'"); $lastcondition=$cmd_rec['VALUE']; //say($ee.":".$this->getProperty("condition").':'.$lastcondition,$msglevel); //say($ee.":".getObject('yw_mycity')->getProperty('condition').':'.$lastcondition,$msglevel); // say($ee.":".$params['NEW_VALUE'].':'.$lastcondition,$msglevel); //getObject('yw_mycity')->getProperty('condition'); //if (($ee=="1") && ($this->getProperty("condition")!=$lastcondition)) { if (($ee=="1") && ($params['NEW_VALUE']!=$lastcondition) && ($condition!="0")) { say(" На улице ".$condition,$msglevel); } } sg("yw_mycity.lastcondition",$this->getProperty("condition")); //$cmd_rec = SQLSelectOne("update yaweather_config set value='".$this->getProperty("condition")."' where parametr='LASTCONDITION'"); SQLexec("update yaweather_config set value='".$params['NEW_VALUE']."' where parametr='LASTCONDITION'");
Методы класса:
$updateTime = gg("yt_settings.updateTime"); if($updateTime > 0){ $count = gg("yt_settings.countTime"); if($count >= $updateTime){ include_once(DIR_MODULES."app_yatraffic/app_yatraffic.class.php"); $app_yatraffic=new app_yatraffic(); $app_yatraffic->get_traffic(gg("yt_settings.reg_id")); sg("yt_settings.countTime",1); } else { $count++; sg("yt_settings.countTime",$count); } }
include_once(DIR_MODULES."app_yatraffic/app_yatraffic.class.php"); $app_yatraffic=new app_yatraffic(); $app_yatraffic->get_traffic(gg("yt_settings.reg_id"));
Объекты класса:
Объекты класса:
Свойства класса:
Объекты класса:
Свойства класса:
Методы класса:
//$url=('http://esp8266:0000@'.($this->getProperty("ip")).'/configtermo?st='.($this->getProperty("Select")).'&ln='.($this->getProperty("Sensor")).'&rmin='.($this->getProperty("rmax")).'&rmax='.($this->getProperty("rmin")).'&gpio='.($this->getProperty("gpio"))); //$this->setProperty('url',$url); //getURL(''.($this->getProperty("url")).'', 0); //getURL('http://esp8266:0000@'.($this->getProperty("ip")).'/configtermo?trn='.($this->getProperty("status")).'&st='.($this->getProperty("Select")).'', 0); $url_1=('http://esp8266:0000@'.($this->getProperty("ip")).'/pwm?ch=0&set='.($this->getProperty("pwd_1")).'&flash=1'); $this->setProperty('url_1',$url_1); $url_2=('http://esp8266:0000@'.($this->getProperty("ip")).'/pwm?ch=1&set='.($this->getProperty("pwd_2")).'&flash=1'); $this->setProperty('url_2',$url_2); If ($this->getProperty("Select")==1) { getURL(''.($this->getProperty("url_1")).'', 0); getURL('http://esp8266:0000@'.($this->getProperty("ip")).'/pwm?ch=1&set=0&flash=1',0); //getURL(''.($this->getProperty("url_2")).'', 0); } If ($this->getProperty("Select")==2) { getURL(''.($this->getProperty("url_2")).'', 0); getURL('http://esp8266:0000@'.($this->getProperty("ip")).'/pwm?ch=0&set=0&flash=1',0); //getURL(''.($this->getProperty("url_2")).'', 0); } If ($this->getProperty("Select")==3) { getURL('http://esp8266:0000@'.($this->getProperty("ip")).'/pwm?ch=0&set=0&flash=1',0); getURL('http://esp8266:0000@'.($this->getProperty("ip")).'/pwm?ch=1&set=0&flash=1',0); //getURL(''.($this->getProperty("url_2")).'', 0); }
Объекты класса:
Свойства класса:
Методы класса:
include_once(DIR_MODULES . 'telegram/telegram.class.php'); $telegram_module = new telegram(); if (gg('Телевизоргостинная.Off_On')==1) { Say('Телевизор включен',2); $telegram_module->sendMessageToAll("Телевизор включен"); } else { Say('Телевизор отключен',2); $telegram_module->sendMessageToAll("Телевизор отключен"); }
Объекты класса:
Свойства класса:
Методы класса:
//$url=('http://esp8266:0000@'.($this->getProperty("ip")).'/configtermo?st='.($this->getProperty("Select")).'&ln='.($this->getProperty("Sensor")).'&rmin='.($this->getProperty("rmax")).'&rmax='.($this->getProperty("rmin")).'&gpio='.($this->getProperty("gpio"))); //$this->setProperty('url',$url); //getURL(''.($this->getProperty("url")).'', 0); //getURL('http://esp8266:0000@'.($this->getProperty("ip")).'/configtermo?trn='.($this->getProperty("status")).'&st='.($this->getProperty("Select")).'', 0); //if ((getGlobal('boiler.status')) =="2") //{ //getURL('http://10.10.13.224/configtermo?trn=2&ts=1', 0); //} else if ((getGlobal('boiler.status')) =="1") //{ //getURL('http://10.10.13.224/configtermo?trn=1&ts=1', 0); //} //getURL('http://esp8266:0000@'.($this->getProperty("ip")).'/configtermo?trn='.($this->getProperty("status")).'&st='.($this->getProperty("Select")).'', 0); //////////////Процедура включения/отключения термостата //$url=('http://esp8266:0000@'.($this->getProperty("ip")).'/configtermo?trn='.($this->getProperty("status")).'&ts='.($this->getProperty("Select"))); //$this->setProperty('url',$url); //getURL(''.($this->getProperty("url")).'', 0); //Откл пока разбираюсь с аварие /////////////////////////////////////////////////////// ////////////Процедура настройки параметров термостата //$url_1=('http://esp8266:0000@'.($this->getProperty("ip")).'/configtermo?rmin0='.($this->getProperty("rmax")).'&rmax0='.($this->getProperty("rmin")).'&ln0='.($this->getProperty("Sensor")).'&gpio0='.($this->getProperty("gpio")).'&st='.($this->getProperty("Select"))); //$this->setProperty('url_1',$url_1); //getURL(''.($this->getProperty("url_1")).'', 0); //Откл пока разбираюсь с аварией ////////////////////////////////////////////////////// //////////////выкл вкл особености прошивки esp8266 //$url_2=('http://esp8266:0000@'.($this->getProperty("ip")).'/configtermo?trn=1&ts=1'); //$url_3=('http://esp8266:0000@'.($this->getProperty("ip")).'/configtermo?trn=2&ts=1'); //getURL('$url_2', 0); //getURL('$url_3', 0); //////////////////////////////////////////////////////
Объекты класса:
, Россия
На форуме: eygen
© 2025 - Site Built By SergeJey | Реквизиты: Курицын С. С. ИНН 762001394609 | Контакты | Публичный договор
SmartLiving