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

77_UWZ: fix Undefined subroutine &main::encode_utf8

git-svn-id: https://svn.fhem.de/fhem/trunk@21827 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
LeonGaultier 2020-05-01 13:37:06 +00:00
parent 2159ebd43e
commit 72055f375a
2 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # 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. # 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: 14_CUL_MAX: new Version, Forum #625108
- change: 10_MAX: new Version, Forum #625108 - change: 10_MAX: new Version, Forum #625108
- bugfix: 74_GardenaSmartDevice: fix password setter - bugfix: 74_GardenaSmartDevice: fix password setter

View File

@ -49,7 +49,9 @@ use warnings;
use POSIX; use POSIX;
use GPUtils qw(GP_Import GP_Export); use GPUtils qw(GP_Import GP_Export);
use FHEM::Meta; use FHEM::Meta;
use Data::Dumper; # Debug only use Encode qw(encode_utf8);
# use Data::Dumper; # Debug only
no no
if $] >= 5.017011, if $] >= 5.017011,
@ -896,12 +898,12 @@ sub JSONAcquire {
my $err_log = "Can't get $URL -- " . $err; my $err_log = "Can't get $URL -- " . $err;
readingsSingleUpdate( $hash, 'lastConnection', $err, 1 ); readingsSingleUpdate( $hash, 'lastConnection', $err, 1 );
Log $hash, 1, 'Error: ' . $err_log; Log $hash, 1, 'Error: ' . $err_log;
return main::encode_utf8( '{"Error": "' . $err . '"}' ); return encode_utf8( '{"Error": "' . $err . '"}' );
} }
Log $hash, 4, Log $hash, 4,
length($data) . ' characters captured: ' . main::encode_utf8($data); length($data) . ' characters captured: ' . encode_utf8($data);
return main::encode_utf8($data); return encode_utf8($data);
} }
##################################### #####################################
@ -1159,8 +1161,6 @@ sub Run {
if ( !exists $uwz_warnings->{Error} ) { if ( !exists $uwz_warnings->{Error} ) {
my $enc = guess_encoding($uwz_warnings); my $enc = guess_encoding($uwz_warnings);
Log $hash, 2, 'DEBUG!!! Response: ' . $uwz_warnings;
$uwz_warncount = scalar( @{ $uwz_warnings->{'results'} } ); $uwz_warncount = scalar( @{ $uwz_warnings->{'results'} } );
Log $hash, 4, 'There are ' . $uwz_warncount . ' warnings active'; Log $hash, 4, 'There are ' . $uwz_warncount . ' warnings active';
my $sortby = AttrVal( $name, 'sort_readings_by', '' ); my $sortby = AttrVal( $name, 'sort_readings_by', '' );
@ -3375,7 +3375,7 @@ sub UWZSearchAreaID {
], ],
"release_status": "stable", "release_status": "stable",
"license": "GPL_2", "license": "GPL_2",
"version": "v3.0.0", "version": "v3.0.1",
"author": [ "author": [
"Marko Oldenburg <leongaultier@gmail.com>" "Marko Oldenburg <leongaultier@gmail.com>"
], ],