From 67aab66dbf90660028fe3964464abcd54d3fff88 Mon Sep 17 00:00:00 2001 From: LeonGaultier Date: Tue, 13 Aug 2019 06:53:45 +0000 Subject: [PATCH] 82_LGTV_WebOS: fix Forum #966380 git-svn-id: https://svn.fhem.de/fhem/trunk@19994 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/82_LGTV_WebOS.pm | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index b958deb38..6ffcfe46c 100644 --- a/fhem/CHANGED +++ b/fhem/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. + - bugfix: 82_LGTV_WebOS: fix Forum #966380 - feature: 93_DbLog: new attr DbLogValueFn propagated as device specific attribute if DbLog is used - bugfix: 70_ZoneMinder: json parsing - again diff --git a/fhem/FHEM/82_LGTV_WebOS.pm b/fhem/FHEM/82_LGTV_WebOS.pm index 7192e9c01..e641d3be9 100644 --- a/fhem/FHEM/82_LGTV_WebOS.pm +++ b/fhem/FHEM/82_LGTV_WebOS.pm @@ -1142,8 +1142,11 @@ sub LGTV_WebOS_WriteReadings($$) { elsif ( defined( $decode_json->{payload}{appId} ) ) { - if ( $decode_json->{payload}{appId} =~ /com.webos.app.externalinput/ - or $decode_json->{payload}{appId} =~ /com.webos.app.hdmi/ ) + if ( ( $decode_json->{payload}{appId} =~ /com.webos.app.externalinput/ + or $decode_json->{payload}{appId} =~ /com.webos.app.hdmi/ ) + and defined ($hash->{helper}{device}{inputapps}{ $decode_json->{payload}{appId} } ) + and $hash->{helper}{device}{inputapps}{ $decode_json->{payload}{appId} } + ) { readingsBulkUpdateIfChanged( $hash, 'input', @@ -1152,12 +1155,16 @@ sub LGTV_WebOS_WriteReadings($$) { readingsBulkUpdateIfChanged( $hash, 'launchApp', '-' ); } - else { + elsif ( defined ( $openAppsPackageName{ $decode_json->{payload}{appId} } ) + and $openAppsPackageName{ $decode_json->{payload}{appId} } ) + { readingsBulkUpdateIfChanged( $hash, 'launchApp', $openAppsPackageName{ $decode_json->{payload}{appId} } ); readingsBulkUpdateIfChanged( $hash, 'input', '-' ); } + + } if ( defined( $decode_json->{type} ) ) { @@ -1999,7 +2006,7 @@ sub LGTV_WebOS_WakeUp_Udp($@) { ], "release_status": "stable", "license": "GPL_2", - "version": "v3.2.0", + "version": "v3.2.1", "author": [ "Marko Oldenburg " ],