From 9b15e181353d71a08c932f858eae5a4b5a54110f Mon Sep 17 00:00:00 2001 From: Dominik Zeiger Date: Tue, 29 May 2012 16:13:38 +0200 Subject: [PATCH] IPSEntertainment - Power on room when the very same source is set again --- .../app/modules/Entertainment/Entertainment_Source.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/IPSLibrary/app/modules/Entertainment/Entertainment_Source.inc.php b/IPSLibrary/app/modules/Entertainment/Entertainment_Source.inc.php index 02abe31..d747016 100644 --- a/IPSLibrary/app/modules/Entertainment/Entertainment_Source.inc.php +++ b/IPSLibrary/app/modules/Entertainment/Entertainment_Source.inc.php @@ -108,12 +108,14 @@ function Entertainment_SyncRoomControls($RoomId) { // --------------------------------------------------------------------------------------------------------------------------- function Entertainment_SetSource($SourceId, $Value, $MessageType=c_MessageType_Action) { - if (GetValue($SourceId) <> $Value) { + $RoomId = IPS_GetParent($SourceId); + $IsRoomPoweredOn = IsRoomPoweredOn($RoomId); + if (GetValue($SourceId) <> $Value || !$IsRoomPoweredOn) { $RoomId = IPS_GetParent($SourceId); $SourceName = get_SourceName($RoomId, $Value); IPSLogger_Inf(__file__, 'Set Source "'.$SourceName.'" of Room '.IPS_GetName($RoomId)); SetValue($SourceId, $Value); - if (!IsRoomPoweredOn($RoomId)) { + if (!$IsRoomPoweredOn) { Entertainment_SetRoomPowerByRoomId($RoomId, true, false); } Entertainment_SetDeviceControlByRoomId($RoomId, c_Control_Muting, false);