2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-20 07:16:03 +00:00

98_JsonMod.pm: #109413: cosmetic api result msg fix

git-svn-id: https://svn.fhem.de/fhem/trunk@21503 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
herrmannj 2020-03-24 21:21:00 +00:00
parent afb4f112b0
commit 15f93038e2

View File

@ -525,13 +525,15 @@ sub JsonMod_ApiResponse {
next if (ref($_) ne 'SCALAR'); next if (ref($_) ne 'SCALAR');
$url =~ s/(\Q${$_}\E)/'X' x length($1)/e; $url =~ s/(\Q${$_}\E)/'X' x length($1)/e;
}; };
$hash->{'SOURCE'} = sprintf('%s (%s)', $url, $param->{'code'} //= ''); $hash->{'SOURCE'} = sprintf('%s (%s)', $url, $param->{'code'} //= '');
$hash->{'API__LAST_MSG'} = $param->{'code'} //= 'failed';
my sub doError { my sub doError {
my ($msg) = @_; my ($msg) = @_;
$hash->{'API__LAST_MSG'} = $msg; $hash->{'API__LAST_MSG'} = $msg;
my $next = Time::HiRes::time() + 600; my $next = Time::HiRes::time() + 600;
$hash->{'API__NEXT_REQ'} = $next; #$hash->{'API__NEXT_REQ'} = $next;
return InternalTimer($next, \&JsonMod_ApiRequest, $hash); return InternalTimer($next, \&JsonMod_ApiRequest, $hash);
}; };