Readings update via CHANGED to fix a side effect from changes in DoTrigger from Oct 2011.
git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@1197 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -62,11 +62,8 @@ sub Weather_UpdateReading($$$$$$) {
|
|||||||
my $name= $hash->{NAME};
|
my $name= $hash->{NAME};
|
||||||
Log 1, "Weather $name: $reading= $value";
|
Log 1, "Weather $name: $reading= $value";
|
||||||
|
|
||||||
#if(!$hash->{LOCAL}) {
|
$hash->{CHANGED}[$n]= "$key: $value";
|
||||||
DoTrigger($name, ReadingsVal($name, $reading, "")); # if($init_done);
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +104,7 @@ sub Weather_GetUpdate($)
|
|||||||
foreach my $condition ( keys ( %$current ) ) {
|
foreach my $condition ( keys ( %$current ) ) {
|
||||||
my $value= $current->{$condition};
|
my $value= $current->{$condition};
|
||||||
Weather_UpdateReading($hash,"",$condition,$tn,$value,$n);
|
Weather_UpdateReading($hash,"",$condition,$tn,$value,$n);
|
||||||
|
$n++;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $fci= $WeatherObj->forecast_information;
|
my $fci= $WeatherObj->forecast_information;
|
||||||
@@ -114,6 +112,7 @@ sub Weather_GetUpdate($)
|
|||||||
my $reading= $i;
|
my $reading= $i;
|
||||||
my $value= $fci->{$i};
|
my $value= $fci->{$i};
|
||||||
Weather_UpdateReading($hash,"",$i,$tn,$value,$n);
|
Weather_UpdateReading($hash,"",$i,$tn,$value,$n);
|
||||||
|
$n++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(my $t= 0; $t<= 3; $t++) {
|
for(my $t= 0; $t<= 3; $t++) {
|
||||||
@@ -122,6 +121,7 @@ sub Weather_GetUpdate($)
|
|||||||
foreach my $condition ( keys ( %$fcc ) ) {
|
foreach my $condition ( keys ( %$fcc ) ) {
|
||||||
my $value= $fcc->{$condition};
|
my $value= $fcc->{$condition};
|
||||||
Weather_UpdateReading($hash,$prefix,$condition,$tn,$value,$n);
|
Weather_UpdateReading($hash,$prefix,$condition,$tn,$value,$n);
|
||||||
|
$n++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user