From 4e8df669d985ccf7ffa300535a8f8221195ed588 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Fri, 13 Dec 2013 11:26:20 +0100 Subject: [PATCH] suppress sending some commands when the tv is not present/responding to polls --- src/LibCecTray/controller/actions/ConnectToDevice.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/LibCecTray/controller/actions/ConnectToDevice.cs b/src/LibCecTray/controller/actions/ConnectToDevice.cs index fa78591..e35906a 100644 --- a/src/LibCecTray/controller/actions/ConnectToDevice.cs +++ b/src/LibCecTray/controller/actions/ConnectToDevice.cs @@ -74,9 +74,12 @@ namespace LibCECTray.controller.actions SendEvent(UpdateEventType.StatusText, Resources.action_sending_power_on); _lib.PowerOnDevices(CecLogicalAddress.Broadcast); - SendEvent(UpdateEventType.StatusText, Resources.action_detecting_tv_vendor); - SendEvent(UpdateEventType.ProgressBar, 30); - SendEvent(UpdateEventType.TVVendorId, (int)_lib.GetDeviceVendorId(CecLogicalAddress.Tv)); + if (_lib.IsActiveDevice(CecLogicalAddress.Tv)) + { + SendEvent(UpdateEventType.StatusText, Resources.action_detecting_tv_vendor); + SendEvent(UpdateEventType.ProgressBar, 30); + SendEvent(UpdateEventType.TVVendorId, (int)_lib.GetDeviceVendorId(CecLogicalAddress.Tv)); + } SendEvent(UpdateEventType.ProgressBar, 50); SendEvent(UpdateEventType.StatusText, Resources.action_detecting_avr); @@ -91,7 +94,7 @@ namespace LibCECTray.controller.actions SendEvent(UpdateEventType.AVRVendorId, (int)_lib.GetDeviceVendorId(CecLogicalAddress.AudioSystem)); } - if (!_lib.GetDevicePowerStatus(CecLogicalAddress.Tv).Equals(CecPowerStatus.On)) + if (_lib.IsActiveDevice(CecLogicalAddress.Tv)&& !_lib.GetDevicePowerStatus(CecLogicalAddress.Tv).Equals(CecPowerStatus.On)) { SendEvent(UpdateEventType.ProgressBar, 70); SendEvent(UpdateEventType.StatusText, Resources.action_activating_source); -- 2.34.1