/**
		 * @public
		 *
		 * Ermöglicht die Synchronisation einer Beleuchtung zu IPSLight
		 *
		 * @param string $state Aktueller Status des Switch
		 */
		public function SyncState($state, IPSComponentSwitch $componentToSync) {
			$componentParamsToSync = $componentToSync->GetComponentParams();
			$deviceConfig          = IPSLight_GetLightConfiguration();
			foreach ($deviceConfig as $deviceIdent=>$deviceData) {
				$componentConfig       = IPSComponent::CreateObjectByParams($deviceData[IPSLIGHT_COMPONENT]);
				$componentParamsConfig = $componentConfig->GetComponentParams();
				if ($componentParamsConfig==$componentParamsToSync) {
					$lightManager = new IPSLight_Manager();
					$lightManager->SynchronizeSwitch($deviceIdent, $state);
				}
			}
		}
	function Entertainment_IPSComponent_SendData($parameters) {
		$interfaceName  = $parameters[0];
		$function       = $parameters[1];
		$roomId         = $parameters[2];
		$value          = $parameters[3];

		$CommConfig = get_CommunicationConfiguration();
		$componentConstructorParams  = $CommConfig[$interfaceName][c_Property_ComponentParams];

		$component = IPSComponent::CreateObjectByParams($componentConstructorParams);
		$component->$function($roomId, $value);
	}
		/**
		 * @public
		 *
		 * Ermöglicht die Synchronisation der aktuellen Position der Beschattung
		 *
		 * @param string $position Aktuelle Position der Beschattung (Wertebereich 0-100)
		 */
		public function SyncPosition($position, IPSComponentShutter $componentToSync) {
			$componentParamsToSync = $componentToSync->GetComponentParams();
			$deviceConfig          = get_ShadowingConfiguration();
			foreach ($deviceConfig as $deviceIdent=>$deviceData) {
				$componentConfig       = IPSComponent::CreateObjectByParams($deviceData[c_Property_Component]);
				$componentParamsConfig = $componentConfig->GetComponentParams();
				if ($componentParamsConfig==$componentParamsToSync) {
					$categoryIdDevices = IPSUtil_ObjectIDByPath('Program.IPSLibrary.data.modules.IPSShadowing.Devices');
					$deviceId = IPS_GetObjectIDByIdent($deviceIdent, $categoryIdDevices);

					$device = new IPSShadowing_Device($deviceId);
					$device->MoveByEvent($position);
				}
			}
		}
Ejemplo n.º 4
0
	function IPSWatering_ActivateWatering($CycleId, $Value, $Mode) {
		$WaterConfig      = get_WateringConfiguration();
		$CircleIdent      = IPS_GetName($CycleId);
		$ComponentParams  = $WaterConfig[$CircleIdent][c_Property_Component];

		if (!IPSWatering_BeforeActivateWatering($CycleId, $Value, $Mode)) {
			return false;
		}

		$component = IPSComponent::CreateObjectByParams($ComponentParams);
		$component->SetState($Value);

		IPSWatering_AfterActivateWatering($CycleId, $Value, $Mode);

		return true;
	}
Ejemplo n.º 5
0
	function NetPlayer_GetIPSComponentPlayer() {
		$player = IPSComponent::CreateObjectByParams(NETPLAYER_COMPONENT);
	   return $player ;
	}
Ejemplo n.º 6
0
		/**
		 * @public
		 *
		 * Methode um autretende Events zu processen
		 *
		 * @param integer $variable ID der auslösenden Variable
		 * @param string $value Wert der Variable
		 */
		public function HandleEvent($variable, $value) {
			$configurationAuto = self::Get_EventConfigurationAuto();
			$configurationCust = self::Get_EventConfigurationCust();

			if (array_key_exists($variable, $configurationCust)) {
				$params = $configurationCust[$variable];
			} elseif (array_key_exists($variable, $configurationAuto)) {
				$params = $configurationAuto[$variable];
			//} elseif ($variable==IPSMH_IRTRANS_BUTTON_VARIABLE_ID) {
				//$params = '';
				//$this->HandleIREvent($variable, $value);
			} else {
				$params = '';
				IPSLogger_Wrn(__file__, 'Variable '.$variable.' NOT found in IPSMessageHandler Configuration!');
			}

			if ($params<>'') {
				if (count($params) < 3) {
					throw new IPSMessageHandlerException('Invalid IPSMessageHandler Configuration, Event Defintion needs 3 parameters');
				}
				$component = IPSComponent::CreateObjectByParams($params[1]);
				$module    = IPSModule::CreateObjectByParams($params[2]);

				if (function_exists('IPSMessageHandler_BeforeHandleEvent')) {
					if (IPSMessageHandler_BeforeHandleEvent($variable, $value, $component, $module)) {
						$component->HandleEvent($variable, $value, $module);
						if (function_exists('IPSMessageHandler_AfterHandleEvent')) {
							IPSMessageHandler_AfterHandleEvent($variable, $value, $component, $module);
						}
					}
				} else {
					$component->HandleEvent($variable, $value, $module);
					if (function_exists('IPSMessageHandler_AfterHandleEvent')) {
						IPSMessageHandler_AfterHandleEvent($variable, $value, $component, $module);
					}
				}
			}
		}