diff --git a/CHANGED b/CHANGED index be4795706..004a60608 100644 --- a/CHANGED +++ b/CHANGED @@ -1,5 +1,6 @@ # 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_BRAVIA: new command "text" to add text to an input field - changed: allowed.pm/fhem.pl: SecurityCheck cleanup, Forum #81509 - new: 88_xs1Bridge: New modul to read xs1 EZcontrol - change: 93_DbRep: V7.0.0, changelog: diff --git a/FHEM/70_BRAVIA.pm b/FHEM/70_BRAVIA.pm index 6af1bed63..ff0dbcf08 100644 --- a/FHEM/70_BRAVIA.pm +++ b/FHEM/70_BRAVIA.pm @@ -198,6 +198,7 @@ sub BRAVIA_Set($@) { $usage .= " mute:" . $mutes; $usage .= " input:" . $inputs if ( $inputs ne "" ); $usage .= " channel:$channels" if ( $channels ne "" ); + $usage .= " text" if (ReadingsVal($name, "requestFormat", "") eq "json"); my $cmd = ''; my $result; @@ -564,6 +565,17 @@ sub BRAVIA_Set($@) { readingsSingleUpdate( $hash, "upnp", $a[2], 1 ) if ( ReadingsVal($name, "upnp", "") ne $a[2] ); } + + # text + elsif ( $a[1] eq "text" ) { + return "No 2nd argument given" if ( !defined( $a[2] ) ); + + shift(@a); shift(@a); + my $text = join(" ", @a); + Log3 $name, 2, "BRAVIA set $name text $text"; + + BRAVIA_SendCommand( $hash, "text", $text ); + } # return usage hint else { @@ -776,6 +788,12 @@ sub BRAVIA_SendCommand($$;$$) { } else { $URL .= "/cersEx/api/" . $service; } + } elsif ($service eq "text") { + $URL .= $port->{SERVICE}; + if ($requestFormat eq "json") { + $URL .= "/sony/appControl"; + $data = "{\"id\":2,\"method\":\"setTextForm\",\"version\":\"1.0\",\"params\":[\"".$cmd."\"]}"; + } } else { $URL .= $port->{SERVICE}; if ($requestFormat eq "json") { @@ -1486,6 +1504,11 @@ sub BRAVIA_ProcessCommandData ($$) { # nothing to do } + # text + elsif ( $service eq "text" ) { + # nothing to do + } + # register elsif ( $service eq "register" ) { readingsBeginUpdate($hash); @@ -1967,6 +1990,8 @@ sub BRAVIA_GetNormalizedName($) { Retrieves current status information from TV.
  • stop
    Stops recording, playing of an internal App, etc.
  • +
  • text
    + Includes the given text into an input field on display.
  • toggle
    Toggles power status of TV.
  • tvpause
    @@ -2073,6 +2098,8 @@ sub BRAVIA_GetNormalizedName($) { Ruft die aktuellen Statusinformationen vom TV ab.
  • stop
    Stoppt die Wiedergabe einer Aufnahme, einer internen App, etc.
  • +
  • text
    + Überträgt den eingegebenen Text in ein Textfeld der Anzeige.
  • toggle
    Wechselt den Einschaltstatus des TV.
  • tvpause