From 75d88eb2a3f5020882bdbcc43d71d8cd5b315bc2 Mon Sep 17 00:00:00 2001 From: teevau Date: Sat, 2 Aug 2014 16:25:27 +0000 Subject: [PATCH] 70_VIERA.pm: Add parameter "HDMI1" - "HDMI4" for command remoteControl to select HDMI input directly Add command "input" to select a HDMI port, TV or SD-Card as source git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@6347 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 4 ++++ fhem/FHEM/70_VIERA.pm | 21 +++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 4eb159ce0..6c7d6ae6e 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,9 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + -feature: 70_VIERA: Add parameter "HDMI1" - "HDMI4" for command remoteControl + to select HDMI input directly. + Add command "input" to select a HDMI port, TV or SD-Card + as source - bugfix: LevelSender: Version 1.0.5: Could not get compiled by the Arduino IDE - feature: PRESENCE: new event "error" and "timeout" for state reading to indicate a non successful check diff --git a/fhem/FHEM/70_VIERA.pm b/fhem/FHEM/70_VIERA.pm index 55c58d6bd..8ffe192c5 100644 --- a/fhem/FHEM/70_VIERA.pm +++ b/fhem/FHEM/70_VIERA.pm @@ -8,9 +8,13 @@ # written 2013 by Tobias Vaupel # # -# Version = 1.22 +# Version = 1.23 # # Version History: +# - 1.23 - 2014-08-01 +# -- Add parameter "HDMI1" - "HDMI4" for command remoteControl to select HDMI input directly +# -- Add command "input" to select a HDMI port, TV or SD-Card as source +# # - 1.22 - 2013-12-28 # -- fixed set command remoteControl # @@ -103,6 +107,10 @@ my %VIERA_remoteControl_args = ( "NRC_D0-ONOFF" => "Digit 0", "NRC_P_NR-ONOFF" => "P-NR (Noise reduction)", "NRC_R_TUNE-ONOFF" => "Seems to do the same as INFO", + "NRC_HDMI1" => "Switch to HDMI input 1", + "NRC_HDMI2" => "Switch to HDMI input 2", + "NRC_HDMI3" => "Switch to HDMI input 3", + "NRC_HDMI4" => "Switch to HDMI input 4", ); @@ -155,7 +163,7 @@ sub VIERA_Set($@){ my $usage = "choose one of off:noArg mute:on,off " . "remoteControl:" . join(",", sort keys %VIERA_remoteControl_args) . " " . "volume:slider,0,1,100 volumeUp:noArg volumeDown:noArg ". - "channel channelUp:noArg channelDown:noArg"; + "channel channelUp:noArg channelDown:noArg input:hdmi1,hdmi2,hdmi3,hdmi4,sdCard,tv"; $usage =~ s/(NRC_|-ONOFF)//g; my $what = lc($a[1]); @@ -249,6 +257,15 @@ sub VIERA_Set($@){ break; } + when("input"){ + $state = uc($state); + return "VIERA: Input $state isn't available." if($state ne "HDMI1" && $state ne "HDMI2" && $state ne "HDMI3" && $state ne "HDMI4" && $state ne "SDCARD" && $state ne "TV"); + $state = "SD_CARD" if ($state eq "SDCARD"); + Log3 $name, 3, "VIERA: Set input $state"; + VIERA_connection(VIERA_BuildXML_NetCtrl($hash,$state), $host); + break; + } + when("?"){ return "$usage"; break;