-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IPSComponent - Added IPSComponentShutter_Tasmota.class.php
- Loading branch information
Andreas Brauneis
committed
Jul 11, 2019
1 parent
ce38bf6
commit 5350eeb
Showing
2 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
96 changes: 96 additions & 0 deletions
96
IPSLibrary/app/core/IPSComponent/IPSComponentShutter/IPSComponentShutter_Tasmota.class.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
|
||
/** @}*/ | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters