2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

FRITZBOX: fixed reset of day counter

git-svn-id: https://svn.fhem.de/fhem/trunk@10600 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
grompo 2016-01-22 20:13:23 +00:00
parent 5ac737d0a4
commit 2b53d69a9b

View File

@ -1575,10 +1575,15 @@ sub FRITZBOX_Readout_Process($$)
# Statistics # Statistics
if ( defined $values{".box_TodayBytesReceivedLow"} && defined $hash->{READINGS}{".box_TodayBytesReceivedLow"}) { if ( defined $values{".box_TodayBytesReceivedLow"} && defined $hash->{READINGS}{".box_TodayBytesReceivedLow"}) {
my $valueHigh = $values{".box_TodayBytesReceivedHigh"} - $hash->{READINGS}{".box_TodayBytesReceivedHigh"}{VAL}; my $valueHigh = $values{".box_TodayBytesReceivedHigh"} - $hash->{READINGS}{".box_TodayBytesReceivedHigh"}{VAL};
my $valueLow = $values{".box_TodayBytesReceivedLow"} - $hash->{READINGS}{".box_TodayBytesReceivedLow"}{VAL};
# Consider reset of day counter
if ($valueHigh < 0 || $valueHigh == 0 && $valueLow < 0) {
$valueLow = $values{".box_TodayBytesReceivedLow"};
$valueHigh = $values{".box_TodayBytesReceivedHigh"};
}
# FRITZBOX_Log $hash, 5, "valueHigh $valueHigh"; # FRITZBOX_Log $hash, 5, "valueHigh $valueHigh";
$valueHigh *= 2**22; $valueHigh *= 2**22;
# FRITZBOX_Log $hash, 5, "valueHigh $valueHigh"; # FRITZBOX_Log $hash, 5, "valueHigh $valueHigh";
my $valueLow = $values{".box_TodayBytesReceivedLow"} - $hash->{READINGS}{".box_TodayBytesReceivedLow"}{VAL};;
# FRITZBOX_Log $hash, 5, "valueLow $valueLow"; # FRITZBOX_Log $hash, 5, "valueLow $valueLow";
$valueLow /= 2**10; $valueLow /= 2**10;
# FRITZBOX_Log $hash, 5, "valueLow $valueLow"; # FRITZBOX_Log $hash, 5, "valueLow $valueLow";