Ejemplo n.º 1
0
	function IPSWatering_LogChange($CircleId, $Value, $ControlId) {
		$CircleName  = get_CirclyNameByID($CircleId);
		$ControlType = get_ControlType($ControlId);
		IPSLogger_Dbg(__file__,"Configuration Change for Circle '$CircleName': $ControlType=$Value");
		if ($Value) {
			IPSWatering_Log("Änderung Konfiguration ('$CircleName'): $ControlType=$Value");
		}
	}
	function get_DeviceControlIdByRoomControlId($RoomControlId, $ControlType=null) {
	   $RoomId = IPS_GetParent($RoomControlId);
		$DeviceNames = get_DeviceNamesByRoomId($RoomId);
		
		if ($ControlType==null) {
			$ControlType = get_ControlType($RoomControlId);
		}
		if ($ControlType == c_Control_Volume or $ControlType == c_Control_Muting or $ControlType == c_Control_RemoteVolume) {
		   $DeviceNames = array_reverse($DeviceNames);
		}
		foreach($DeviceNames as $DeviceName) {
			$DeviceControlId = get_ControlIdByDeviceName($DeviceName, $ControlType, false);
			if ($DeviceControlId !== false) {
			   return $DeviceControlId;
			}
		}
		return false;
	}
	 *
	 * @file          IPSWatering_ChangeSettings.ips.php
	 * @author        Andreas Brauneis
	 * @version
	 * Version 2.50.1, 11.03.2012<br/>
	 *
	 * Script wird für das WebFront um Änderungen an den Variablen vorzunehmen
	 *
	 */

	include_once "IPSWatering.inc.php";

	if ($_IPS['SENDER']=='WebFront') {
		$ControlId   = $_IPS['VARIABLE'];
		$CircleId    = get_CirclyIdByControlId($ControlId);
		$ControlType = get_ControlType($ControlId);
	
		switch($ControlType) {
			case c_Control_Active:
				IPSWatering_SetActive($ControlId, $_IPS['VALUE'], c_Mode_StartManual);
				break;
			case c_Control_StartTime:
			case c_Control_Duration:
			case c_Control_Program:
			case c_Control_Sensor:
			case c_Control_Automatic:
				IPSWatering_SetValue($ControlId, $_IPS['VALUE']);
				break;
			default:
				IPSLogger_Err(__file__, "Error Unknown ControlType $ControlType");
				Exit;
	 * Zusätzlich wird es auch von Register Variablen bzw. anderen Variablen per Event getriggert.
	 *
	 * @file          Entertainment_Interface.ips.php
	 * @author        Andreas Brauneis
	 * @version
	 * Version 2.50.1, 31.01.2012<br/>
	 *
	 */

	include_once "Entertainment.inc.php";

	// ---------------------------------------------------------------------------------------------------------------------------
	// WebFront
	// ---------------------------------------------------------------------------------------------------------------------------
	if ($IPS_SENDER == "WebFront") {
		$ControlType = get_ControlType($IPS_VARIABLE);
		switch ($ControlType) {
		   case c_Control_RoomPower:
		      Entertainment_SetRoomPower($IPS_VARIABLE, $IPS_VALUE);
		      break;
		   case c_Control_DevicePower:
		      Entertainment_SetDevicePower($IPS_VARIABLE, $IPS_VALUE);
		      break;
		   case c_Control_Source:
		      Entertainment_SetSource($IPS_VARIABLE, $IPS_VALUE);
		      break;
		   case c_Control_Group:
		      Entertainment_SetGroupControlVisibility($IPS_VARIABLE, $IPS_VALUE);
		      break;
		   case c_Control_Muting:
		   case c_Control_Volume:
Ejemplo n.º 5
0
	function Entertainment_SetDeviceControl($DeviceControlId, $Value) {
		$ControlType = get_ControlType($DeviceControlId);
		switch ($ControlType) {
		   case c_Control_Volume:
		      Entertainment_SetVolume($DeviceControlId, $Value);
		      break;
		   case c_Control_Balance:
		      Entertainment_SetBalance($DeviceControlId, $Value);
		      break;
		   case c_Control_Treble:
		      Entertainment_SetTreble($DeviceControlId, $Value);
		      break;
		   case c_Control_Middle:
		      Entertainment_SetMiddle($DeviceControlId, $Value);
		      break;
		   case c_Control_Bass:
		      Entertainment_SetBass($DeviceControlId, $Value);
		      break;
		   case c_Control_Muting:
		      Entertainment_SetMuting($DeviceControlId, $Value);
		      break;
		   case c_Control_Mode:
		      Entertainment_SetMode($DeviceControlId, $Value);
		      break;
		   case c_Control_Program:
		      Entertainment_SetProgram($DeviceControlId, $Value);
		      break;
		   case c_Control_Source:
		   case c_Control_RoomPower:
		   case c_Control_DevicePower:
				IPSLogger_Err(__file__, 'Controls of Type "'.$ControlType.'" cannot be handled with this function, ID='.$DeviceControlId.' !');
		      break;
			default:
				IPSLogger_Err(__file__, 'Unknown DeviceControl with ID='.$DeviceControlId.' !');
		}
	}