Skip to content

Commit

Permalink
IPSComponent - Added IPSComponentShutter_Tasmota.class.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Brauneis committed Jul 11, 2019
1 parent ce38bf6 commit 5350eeb
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?
/**@addtogroup ipscomponent
* @{
*
*
* @file IPSComponentShutter_Tasmota.class.php
* @author Andreas Brauneis
*
*
*/

/**
* @class IPSComponentShutter_Tasmota
*
* Definiert ein IPSComponentShutter_Tasmota Object, das ein IPSComponentShutter Object für Enocean implementiert.
*
* @author Andreas Brauneis
* @version
* Version 2.50.1, 01.07.2019<br/>
*/

IPSUtils_Include ('IPSComponentShutter.class.php', 'IPSLibrary::app::core::IPSComponent::IPSComponentShutter');

class IPSComponentShutter_Tasmota extends IPSComponentShutter {

private $instanceId;

/**
* @public
*
* Initialisierung eines IPSComponentShutter_Tasmota Objektes
*
* @param integer $instanceId InstanceId des Enocean Devices
*/
public function __construct($instanceId) {
$this->instanceId = IPSUtil_ObjectIDByPath($instanceId);
}

/**
* @public
*
* Funktion liefert String IPSComponent Constructor String.
* String kann dazu benützt werden, das Object mit der IPSComponent::CreateObjectByParams
* wieder neu zu erzeugen.
*
* @return string Parameter String des IPSComponent Object
*/
public function GetComponentParams() {
return get_class($this).','.$this->instanceId;
}

/**
* @public
*
* Function um Events zu behandeln, diese Funktion wird vom IPSMessageHandler aufgerufen, um ein aufgetretenes Event
* an das entsprechende Module zu leiten.
*
* @param integer $variable ID der auslösenden Variable
* @param string $value Wert der Variable
* @param IPSModuleShutter $module Module Object an das das aufgetretene Event weitergeleitet werden soll
*/
public function HandleEvent($variable, $value, IPSModuleShutter $module){
$name = IPS_GetName($variable);
throw new IPSComponentException('Event Handling NOT supported for Variable '.$variable.'('.$name.')');
}

/**
* @public
*
* Hinauffahren der Beschattung
*/
public function MoveUp(){
Tasmota_setPower($this->instanceId, 1, true);
}

/**
* @public
*
* Hinunterfahren der Beschattung
*/
public function MoveDown(){
Tasmota_setPower($this->instanceId, 2, true);
}

/**
* @public
*
* Stop
*/
public function Stop() {
Tasmota_setPower($this->instanceId, 1, false);
}
}

/** @}*/
?>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Version="2.50.67"
Version="2.50.68"
InstallVersion="2.50.1"
ModuleNamespace="IPSLibrary::app::core::IPSComponent"
[App]
Expand Down Expand Up @@ -49,6 +49,7 @@ ScriptFiles[]="IPSComponentShutter\IPSComponentShutter_LCN.class.php"
ScriptFiles[]="IPSComponentShutter\IPSComponentShutter_EIB.class.php"
ScriptFiles[]="IPSComponentShutter\IPSComponentShutter_MoellerEaton.class.php"
ScriptFiles[]="IPSComponentShutter\IPSComponentShutter_zwave.class.php"
ScriptFiles[]="IPSComponentShutter\IPSComponentShutter_Tasmota.class.php"
ScriptFiles[]="IPSComponentShutter\IPSModuleShutter.class.php"
ScriptFiles[]="IPSComponentShutter\IPSModuleShutter_IPSShadowing.class.php"
ScriptFiles[]="IPSComponentSwitch\IPSComponentSwitch.class.php"
Expand Down Expand Up @@ -182,3 +183,4 @@ IPSLogger="2.50.2"
2.50.65="Fixed IPSComponentShutter_zwave.class"
2.50.66="Neue Axis Kamera Anbindung (P1344)"
2.50.67="Fixed MediaPlayer Component"
2.50.68="Added IPSComponentShutter_Tasmota.class"

0 comments on commit 5350eeb

Please sign in to comment.