70_BRAVIA.pm: fixed hash for space in application, channel, input names

git-svn-id: https://svn.fhem.de/fhem/trunk@15895 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
vuffiraa
2018-01-14 20:46:28 +00:00
parent 7ebce9228c
commit 786d3c0703
2 changed files with 21 additions and 13 deletions

View File

@@ -1,5 +1,7 @@
# 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.
- bugfix: 70_BRAVIA: fixed hash for space
(application, channel, input names)
- change: 93_DbLog: change verbose level of addlog from 2 to 4
- bugfix: 93_DbRep: old dumpfiles not deleted by dumpMySQL clientSide
- bugfix: 70_BRAVIA: typo fixed, 'set application' works now

View File

@@ -416,14 +416,16 @@ sub BRAVIA_Set($@) {
BRAVIA_Set( $hash, $name, "on" );
}
Log3 $name, 2, "BRAVIA set $name " . $a[1] . " " . $a[2];
shift(@a); shift(@a);
my $channelStr = join("#", @a);
Log3 $name, 2, "BRAVIA set $name " . $a[1] . " " . $channelStr;
return
"No argument given, choose one of channel presetNumber channelName "
if ( !defined( $a[2] ) );
if ( !defined( $channelStr ) );
if ( $presence eq "present" ) {
my $channelName = $a[2];
my $channelName = $channelStr;
if ( $channelName =~ /^(\d)(\d?)(\d?)(\d?):.*$/ ) {
BRAVIA_SendCommand( $hash, "ircc", $1, "blocking" );
BRAVIA_SendCommand( $hash, "ircc", $2, "blocking" ) if (defined($2));
@@ -466,21 +468,23 @@ sub BRAVIA_Set($@) {
return "No 2nd argument given" if ( !defined( $a[2] ) );
Log3 $name, 2, "BRAVIA set $name " . $a[1] . " " . $a[2];
shift(@a); shift(@a);
my $inputStr = join("#", @a);
Log3 $name, 2, "BRAVIA set $name " . $a[1] . " " . $inputStr;
# Resolve input uri
my $input_uri;
if ( defined( $hash->{helper}{device}{inputPreset}{ $a[2] } ) ) {
$input_uri = $hash->{helper}{device}{inputPreset}{ $a[2] }{uri};
if ( defined( $hash->{helper}{device}{inputPreset}{ $inputStr } ) ) {
$input_uri = $hash->{helper}{device}{inputPreset}{ $inputStr }{uri};
} else {
return "Unknown source input '" . $a[2] . "' on that device.";
return "Unknown source input '" . $inputStr . "' on that device.";
}
if ( $presence eq "present" ) {
BRAVIA_SendCommand( $hash, "setPlayContent", $input_uri );
if ( ReadingsVal($name, "input", "") ne $a[2] ) {
readingsSingleUpdate( $hash, "input", $a[2], 1 );
if ( ReadingsVal($name, "input", "") ne $inputStr ) {
readingsSingleUpdate( $hash, "input", $inputStr, 1 );
}
}
else {
@@ -497,14 +501,16 @@ sub BRAVIA_Set($@) {
return "No 2nd argument given" if ( !defined( $a[2] ) );
Log3 $name, 2, "BRAVIA set $name " . $a[1] . " " . $a[2];
shift(@a); shift(@a);
my $appStr = join("#", @a);
Log3 $name, 2, "BRAVIA set $name " . $a[1] . " " . $appStr;
# Resolve app uri
my $app_uri;
if ( defined( $hash->{helper}{device}{appPreset}{ $a[2] } ) ) {
$app_uri = $hash->{helper}{device}{appPreset}{ $a[2] }{uri};
if ( defined( $hash->{helper}{device}{appPreset}{ $appStr } ) ) {
$app_uri = $hash->{helper}{device}{appPreset}{ $appStr }{uri};
} else {
return "Unknown app '" . $a[2] . "' on that device.";
return "Unknown app '" . $appStr . "' on that device.";
}
if ( $presence eq "present" ) {