From a62bbda796db360a2853e53cccc2a62294b4f590 Mon Sep 17 00:00:00 2001 From: herrmannj <> Date: Fri, 15 Jan 2016 17:25:21 +0000 Subject: [PATCH] 32_TechemHKV.pm: timestamp at midnight for log fix2 git-svn-id: https://svn.fhem.de/fhem/trunk@10514 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/32_TechemHKV.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/32_TechemHKV.pm b/fhem/FHEM/32_TechemHKV.pm index 019731349..55c3a4373 100644 --- a/fhem/FHEM/32_TechemHKV.pm +++ b/fhem/FHEM/32_TechemHKV.pm @@ -119,6 +119,7 @@ TechemHKV_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 readingsBeginUpdate($hash); readingsBulkUpdate($hash, "temp1", $msg->{temp1}); @@ -132,9 +133,8 @@ TechemHKV_Receive(@) { readingsBeginUpdate($hash); $hash->{".updateTimestamp"} = $ts; readingsBulkUpdate($hash, "current_period", $msg->{actualVal}); - $hash->{CHANGETIME}->[0] = $ts; + $hash->{CHANGETIME}->[$#{ $hash->{CHANGED} }] = $ts; readingsEndUpdate($hash, 1); - delete $hash->{CHANGETIME}; } # billing period changed @@ -144,9 +144,8 @@ TechemHKV_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;