diff --git a/FHEM/82_LGTV_WebOS.pm b/FHEM/82_LGTV_WebOS.pm index d129a2a..8f69fcd 100644 --- a/FHEM/82_LGTV_WebOS.pm +++ b/FHEM/82_LGTV_WebOS.pm @@ -368,7 +368,7 @@ __END__ ], "release_status": "stable", "license": "GPL_2", - "version": "v3.6.2", + "version": "v3.6.5", "author": [ "Marko Oldenburg " ], diff --git a/controls_LGTV_WebOS.txt b/controls_LGTV_WebOS.txt index 3163361..50742c5 100644 --- a/controls_LGTV_WebOS.txt +++ b/controls_LGTV_WebOS.txt @@ -1,2 +1,2 @@ -UPD 2022-03-13_11:13:55 18968 FHEM/82_LGTV_WebOS.pm -UPD 2022-03-13_11:13:52 54282 lib/FHEM/Devices/LGTV/LGTVWebOS.pm +UPD 2022-03-29_08:00:00 18968 FHEM/82_LGTV_WebOS.pm +UPD 2022-03-31_06:22:06 55075 lib/FHEM/Devices/LGTV/LGTVWebOS.pm diff --git a/lib/FHEM/Devices/LGTV/LGTVWebOS.pm b/lib/FHEM/Devices/LGTV/LGTVWebOS.pm index e39e970..b8d5308 100644 --- a/lib/FHEM/Devices/LGTV/LGTVWebOS.pm +++ b/lib/FHEM/Devices/LGTV/LGTVWebOS.pm @@ -704,7 +704,24 @@ sub Write { unless ( $hash->{CD} ); ::Log3( $name, 4, "LGTV_WebOS ($name) - $string" ); - syswrite( $hash->{CD}, $string ); + + try { + syswrite( $hash->{CD}, $string ); + } + catch { + if ( $_->isa('autodie::exception') && $_->matches(':io') ) { + ::Log3( $name, 2, +"LGTV_WebOS ($name) - can't write to socket, autodie exception: $_" + ); + return; + } + else { + ::Log3( $name, 2, + "LGTV_WebOS ($name) - can't write to socket: $_" ); + return; + } + }; + return; } @@ -736,7 +753,23 @@ sub Read { $hash->{helper}->{lastResponse} = int( ::gettimeofday() ); # Check Socket KeepAlive - $len = sysread( $hash->{CD}, $buf, 10240 ); + + try { + $len = sysread( $hash->{CD}, $buf, 10240 ); + } + catch { + if ( $_->isa('autodie::exception') && $_->matches(':io') ) { + ::Log3( $name, 2, +"LGTV_WebOS ($name) - can't read from socket, autodie exception: $_" + ); + return; + } + else { + ::Log3( $name, 2, + "LGTV_WebOS ($name) - can't read from socket: $_" ); + return; + } + }; if ( !defined($len) || !$len ) {