59_LuftdatenInfo: fix error handling for loca malformed JSON string

git-svn-id: https://svn.fhem.de/fhem/trunk@14224 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
igami
2017-05-09 04:13:22 +00:00
parent 96bd0a704c
commit 33c947ba23

View File

@@ -244,7 +244,10 @@ sub LuftdatenInfo_ParseHttpResponse($) {
readingsSingleUpdate($hash, "state", "error", 1); readingsSingleUpdate($hash, "state", "error", 1);
} }
elsif($data !~ /^\[.*\]$/s){ elsif(
$connection eq "remote" && $data !~ /^\[.*\]$/s
|| $connection eq "local" && $data !~ /^\{.*\}$/s
){
Log3( Log3(
$SELF, 2, "$TYPE ($SELF) - error while request: malformed JSON string" $SELF, 2, "$TYPE ($SELF) - error while request: malformed JSON string"
); );