コード例 #1
0
	function Entertainment_SetRemoteControl($Id, $Value) {
	   $DeviceName = IPS_GetName(IPS_GetParent($Id));
		if (!isDevicePoweredOnByDeviceName($DeviceName)) {
		  return;
		}
		IPSLogger_Dbg(__file__, 'Set RemoteControl for Device "'.$DeviceName.'": '.$Value);
		SetValue($Id, $Value);
		Entertainment_SetRoomControlByDeviceControlId($Id, $Value);
	}
コード例 #2
0
	function Entertainment_SetMuting($Id, $Value, $MessageType=c_MessageType_Action) {
	   $DeviceName = IPS_GetName(IPS_GetParent($Id));
		if (!isDevicePoweredOnByDeviceName($DeviceName)) {
			return;
		}
	   if (!is_bool($Value)) { 												/*Toggle Power Value*/
	      $Value = !GetValue($Id);
		}
		if (GetValue($Id) <> $Value) {
			IPSLogger_Inf(__file__, 'Set Muting "'.bool2OnOff($Value).'" for Device "'.$DeviceName.'"');
			SetValue($Id, $Value);
			if ($Value) {
		  		Entertainment_SendDataByDeviceName($DeviceName, c_Control_Muting,
				  			array(c_Property_CommMuteOn, c_Property_CommMute), $MessageType);
			} else {
		  		Entertainment_SendDataByDeviceName($DeviceName, c_Control_Muting,
				  			array(c_Property_CommMuteOff, c_Property_CommMute), $MessageType);
			}
			Entertainment_SetRoomControlByDeviceControlId($Id, $Value);
		}
	}