From 72055f375a67cb4b312027b9ad3eadbf81796447 Mon Sep 17 00:00:00 2001 From: LeonGaultier Date: Fri, 1 May 2020 13:37:06 +0000 Subject: [PATCH] 77_UWZ: fix Undefined subroutine &main::encode_utf8 git-svn-id: https://svn.fhem.de/fhem/trunk@21827 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/77_UWZ.pm | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 93503e53c..0c01b46cf 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: 77_UWZ: fix Undefined subroutine &main::encode_utf8 - change: 14_CUL_MAX: new Version, Forum #625108 - change: 10_MAX: new Version, Forum #625108 - bugfix: 74_GardenaSmartDevice: fix password setter diff --git a/fhem/FHEM/77_UWZ.pm b/fhem/FHEM/77_UWZ.pm index 7be42ff02..58f2e6468 100644 --- a/fhem/FHEM/77_UWZ.pm +++ b/fhem/FHEM/77_UWZ.pm @@ -49,7 +49,9 @@ use warnings; use POSIX; use GPUtils qw(GP_Import GP_Export); use FHEM::Meta; -use Data::Dumper; # Debug only +use Encode qw(encode_utf8); + +# use Data::Dumper; # Debug only no if $] >= 5.017011, @@ -896,12 +898,12 @@ sub JSONAcquire { my $err_log = "Can't get $URL -- " . $err; readingsSingleUpdate( $hash, 'lastConnection', $err, 1 ); Log $hash, 1, 'Error: ' . $err_log; - return main::encode_utf8( '{"Error": "' . $err . '"}' ); + return encode_utf8( '{"Error": "' . $err . '"}' ); } Log $hash, 4, - length($data) . ' characters captured: ' . main::encode_utf8($data); - return main::encode_utf8($data); + length($data) . ' characters captured: ' . encode_utf8($data); + return encode_utf8($data); } ##################################### @@ -1159,8 +1161,6 @@ sub Run { if ( !exists $uwz_warnings->{Error} ) { my $enc = guess_encoding($uwz_warnings); - Log $hash, 2, 'DEBUG!!! Response: ' . $uwz_warnings; - $uwz_warncount = scalar( @{ $uwz_warnings->{'results'} } ); Log $hash, 4, 'There are ' . $uwz_warncount . ' warnings active'; my $sortby = AttrVal( $name, 'sort_readings_by', '' ); @@ -3375,7 +3375,7 @@ sub UWZSearchAreaID { ], "release_status": "stable", "license": "GPL_2", - "version": "v3.0.0", + "version": "v3.0.1", "author": [ "Marko Oldenburg " ],