bugfix: enabled logging for 59_Weather.pm (Boris)

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@967 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
neubert
2011-08-04 19:31:23 +00:00
parent 72eaf83a44
commit a32b902bac
4 changed files with 22 additions and 13 deletions

View File

@@ -3,6 +3,7 @@
- feature: CUL_TX added (thanks to Peterp) - feature: CUL_TX added (thanks to Peterp)
- feature: TCM120 / EnOcean parser added - feature: TCM120 / EnOcean parser added
- feature: eventMap enhanced - feature: eventMap enhanced
- bugfix: enabled logging for 59_Weather.pm (Boris)
- 2011-07-08 (5.1) - 2011-07-08 (5.1)
- feature: smallscreen optimizations for iPhone - feature: smallscreen optimizations for iPhone

View File

@@ -37,9 +37,9 @@ sub f_to_c($) {
} }
################################### ###################################
sub Weather_UpdateReading($$$$$) { sub Weather_UpdateReading($$$$$$) {
my ($hash,$prefix,$key,$tn,$value)= @_; my ($hash,$prefix,$key,$tn,$value,$n)= @_;
return 0 if(!defined($value) || $value eq ""); return 0 if(!defined($value) || $value eq "");
return 0 if($key eq "unit_system"); return 0 if($key eq "unit_system");
@@ -59,7 +59,14 @@ sub Weather_UpdateReading($$$$$) {
my $r= $hash->{READINGS}; my $r= $hash->{READINGS};
$r->{$reading}{TIME}= $tn; $r->{$reading}{TIME}= $tn;
$r->{$reading}{VAL} = $value; $r->{$reading}{VAL} = $value;
Log 5, "Weather $hash->{NAME}: $reading= $value";
my $name= $hash->{NAME};
Log 1, "Weather $name: $reading= $value";
#if(!$hash->{LOCAL}) {
DoTrigger($name, ReadingsVal($name, $reading, "")); # if($init_done);
#}
return 1; return 1;
} }
@@ -75,6 +82,8 @@ sub Weather_GetUpdate($)
my $name = $hash->{NAME}; my $name = $hash->{NAME};
my $n= 0;
# time # time
my $tn = TimeNow(); my $tn = TimeNow();
@@ -97,14 +106,14 @@ sub Weather_GetUpdate($)
my $current = $WeatherObj->current_conditions; my $current = $WeatherObj->current_conditions;
foreach my $condition ( keys ( %$current ) ) { foreach my $condition ( keys ( %$current ) ) {
my $value= $current->{$condition}; my $value= $current->{$condition};
Weather_UpdateReading($hash,"",$condition,$tn,$value); Weather_UpdateReading($hash,"",$condition,$tn,$value,$n);
} }
my $fci= $WeatherObj->forecast_information; my $fci= $WeatherObj->forecast_information;
foreach my $i ( keys ( %$fci ) ) { foreach my $i ( keys ( %$fci ) ) {
my $reading= $i; my $reading= $i;
my $value= $fci->{$i}; my $value= $fci->{$i};
Weather_UpdateReading($hash,"",$i,$tn,$value); Weather_UpdateReading($hash,"",$i,$tn,$value,$n);
} }
for(my $t= 0; $t<= 3; $t++) { for(my $t= 0; $t<= 3; $t++) {
@@ -112,14 +121,10 @@ sub Weather_GetUpdate($)
my $prefix= sprintf("fc%d_", $t); my $prefix= sprintf("fc%d_", $t);
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); Weather_UpdateReading($hash,$prefix,$condition,$tn,$value,$n);
} }
} }
if(!$hash->{LOCAL}) {
DoTrigger($name, undef) if($init_done);
}
return 1; return 1;
} }

View File

@@ -477,4 +477,7 @@
on-till and on-for-timer commands (Boris) on-till and on-for-timer commands (Boris)
- Thu Jun 30 2011 (Maz Rashid) - Thu Jun 30 2011 (Maz Rashid)
- Introducing 00_TUL.pm and 10_EIB.pm modules for connecting FHEM on EIB. - Introducing 00_TUL.pm and 10_EIB.pm modules for connecting FHEM on EIB.
- Thu Aug 04 2011 (Boris)
- enabled logging for 59_Weather.pm

View File

@@ -20,7 +20,7 @@ xx: measured distance in cm
code: code:
hex bin hex bin
37 00110111 30s message interval, normal operation 37 00110111 30min message interval, normal operation
B7 10110111 3s message interval, normal operation B7 10110111 3s message interval, normal operation
F7 11110111 3s message interval, battery low F7 11110111 3s message interval, battery low
|||+++++-- 0x17 always 0x17 |||+++++-- 0x17 always 0x17
@@ -38,4 +38,4 @@ measured distance from ultrasound sender/transmitter:
2.00 m 0xC4 196 2.00 m 0xC4 196
It is assumed that xx is the distance in centimeters from the top of the box It is assumed that xx is the distance in centimeters from the top of the box
(4 cm box height + 1 cm height of ultrasound sender/transmitter). (4 cm box height + 1 cm height of ultrasound sender/transmitter).