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

32_TechemWZ.pm: timestamp at midnight for log fix2

git-svn-id: https://svn.fhem.de/fhem/trunk@10513 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
herrmannj 2016-01-15 17:24:59 +00:00
parent 66c9ebcb4f
commit 58794e9ffd

View File

@ -140,6 +140,7 @@ TechemWZ_Receive(@) {
$hash->{VERSION} = $msg->{version};
$hash->{METER} = $typeText{$msg->{type}};
delete $hash->{CHANGETIME}; # clean up, workaround for fhem prior http://forum.fhem.de/index.php/topic,47474.msg391964.html#msg391964
# day period changed
$ats = ReadingsTimestamp($hash->{NAME},"current_period", "0");
@ -149,9 +150,8 @@ TechemWZ_Receive(@) {
$hash->{".updateTimestamp"} = $ts;
readingsBulkUpdate($hash, "meter", $msg->{meter});
readingsBulkUpdate($hash, "current_period", $msg->{actualVal});
$hash->{CHANGETIME}->[0] = $ts;
$hash->{CHANGETIME}->[$#{ $hash->{CHANGED} }] = $ts;
readingsEndUpdate($hash, 1);
delete $hash->{CHANGETIME};
}
# billing period changed
@ -161,9 +161,8 @@ TechemWZ_Receive(@) {
readingsBeginUpdate($hash);
$hash->{".updateTimestamp"} = $ts;
readingsBulkUpdate($hash, "previous_period", $msg->{lastVal});
$hash->{CHANGETIME}->[0] = $ts;
$hash->{CHANGETIME}->[$#{ $hash->{CHANGED} }] = $ts;
readingsEndUpdate($hash, 1);
delete $hash->{CHANGETIME};
}
return undef;
@ -242,7 +241,11 @@ TechemWZ_Parse(@) {
push @d, $deviceHash->{NAME};
}
if defined($d[0]) {
return (@d);
} else {
return (''); # discard neighbor devices
}
}
sub