Permalink
Browse files

Merge branch 'master' of https://github.com/T-REX-XP/SSDPFinder

  • Loading branch information...
YuriiNazarenkoDevPro committed Jul 31, 2018
2 parents 701dd00 + e407c98 commit 120439445119e5d08441f61cadcb83393200efba
@@ -1,2 +1,18 @@
<?php
require(dirname(__FILE__).'/../ssdp_finder/upnp/vendor/jalder/upnp/src/Yeelight/Yeelight.class.php');
$adress = $this->getProperty("CONTROLADDRESS");
$status = $this->getProperty("changetemp");
$yee = new Yeelight($adress);
$yee->set_power("on"); // power on
$result = $yee->set_bright($status); // power off
//print_r($result);
if ($result) {
$this->setProperty('status', 1);
} else {
$this->setProperty('status', 0);
$this->setProperty('alive', 0);
say ("Выключатель ".$this->object_title." размещенный в комнате ".$this->getProperty("linkedRoom")." не сработал!", 2);
};
$yee->disconnect();
@@ -7,7 +7,11 @@
<button style='display:%.alive|"none;block;none;"%;float:right;font-size: 50%; font-family: monospace;'><span class="glyphicon glyphicon-ok"></span></span></button>
<button style='display:%.alive|"block;none;block;"%;float:right;font-size: 50%; font-family: monospace;'><span class="glyphicon glyphicon-remove"></span></button>
</div>
<input type="text" id="color%.object_id%" class="colorpicker" value="%.colorSaved%" onChange='callMethod("%.object_title%.changecolor","color="+encodeURIComponent(this.value));'/>
<input type="range" onChange='ajaxSetGlobal("%.object_title%.changetemp", value);' value=%.changetemp% min="0" max="100" step="5" style="width:100%; height: 15px; display: inline-block;" ></input>
<script>
$("#color%.object_id%").spectrum({
preferredFormat: "hex",
@@ -98,15 +98,15 @@
[#end LOCATIONS#]
</select></div>
</div>
<!-- LINKED_OBJECT (varchar) -->
<!-- LINKED_OBJECT (varchar)
<div class="form-group">
<label class="col-lg-3 control-label" [#if ERR_LINKED_OBJECT#] style="color:red;font-weight:bold" [#endif#]>
<#LANG_LINKED_OBJECT#>:
</label>
<div class="col-lg-4">
<input type="text" class="form-control" name="linked_object" value="[#LINKED_OBJECT#]" id="linked_object">
</div>
</div>
</div> -->
<!-- CONTROL ADDRESS (varchar) -->
<div class="form-group">
<label class="col-lg-3 control-label" [#if ERR_CONTROLADDRESS#] style="color:red;font-weight:bold" [#endif#]>

0 comments on commit 1204394

Please sign in to comment.