2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

59_LuftdatenInfo: fix readings for local request

git-svn-id: https://svn.fhem.de/fhem/trunk@14242 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
igami 2017-05-10 16:38:24 +00:00
parent 3abbe48913
commit 268690366e

View File

@ -386,24 +386,25 @@ sub LuftdatenInfo_ParseHttpResponse($) {
foreach (@{$data->{sensordatavalues}}){
$_->{value} =~ m/^(\S+)(\s|$)/;
$_->{value} = $1;
if($_->{value_type} =~ /temperature$/){
readingsBulkUpdate($hash, "temperature", $1);
readingsBulkUpdate($hash, "temperature", $_->{value});
}
elsif($_->{value_type} =~ /humidity$/){
readingsBulkUpdate($hash, "humidity", $1);
readingsBulkUpdate($hash, "humidity", $_->{value});
}
elsif($_->{value_type} =~ /pressure$/){
readingsBulkUpdate($hash, "pressure", $1);
readingsBulkUpdate($hash, "pressure", $_->{value});
}
elsif($_->{value_type} eq "SDS_P1"){
readingsBulkUpdate($hash, "PM10", $1);
readingsBulkUpdate($hash, "PM10", $_->{value});
}
elsif($_->{value_type} eq "SDS_P2"){
readingsBulkUpdate($hash, "PM2.5", $1);
readingsBulkUpdate($hash, "PM2.5", $_->{value});
}
elsif($_->{value_type} eq "signal"){
readingsBulkUpdate($hash, "signal", $1);
readingsBulkUpdate($hash, "signal", $_->{value});
}
}