2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

70_BRAVIA.pm: set text - to fill an input field

git-svn-id: https://svn.fhem.de/fhem/trunk@15689 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
vuffiraa 2017-12-25 16:55:12 +00:00
parent f0a67df5a5
commit 328716f8ac
2 changed files with 28 additions and 0 deletions

View File

@ -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:

View File

@ -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.</li>
<li><i>stop</i><br>
Stops recording, playing of an internal App, etc.</li>
<li><i>text</i><br>
Includes the given text into an input field on display.</li>
<li><i>toggle</i><br>
Toggles power status of TV.</li>
<li><i>tvpause</i><br>
@ -2073,6 +2098,8 @@ sub BRAVIA_GetNormalizedName($) {
Ruft die aktuellen Statusinformationen vom TV ab.</li>
<li><i>stop</i><br>
Stoppt die Wiedergabe einer Aufnahme, einer internen App, etc.</li>
<li><i>text</i><br>
Überträgt den eingegebenen Text in ein Textfeld der Anzeige.</li>
<li><i>toggle</i><br>
Wechselt den Einschaltstatus des TV.</li>
<li><i>tvpause</i><br>