From b6c0dc2ef1bc43c8dbbaa82af0b55f7f52e88fd4 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Wed, 14 Dec 2022 11:08:36 +0100 Subject: [PATCH] fix delete Reading Counter --- 59_Weather.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/59_Weather.pm b/59_Weather.pm index ff30d3a..d7c242e 100755 --- a/59_Weather.pm +++ b/59_Weather.pm @@ -334,18 +334,18 @@ sub Weather_DeleteReadings { my $name = $hash->{NAME}; my $forecastConfig = Weather_ForcastConfig($hash); - my $forecastLimit = AttrVal( $name, 'forecastLimit', 5 ); + my $forecastLimit = AttrVal( $name, 'forecastLimit', 5 ) + 1; my $forecastLimitNoForecast = 1; $forecastLimit = $forecastLimitNoForecast if ( !$forecastConfig->{daily} ); CommandDeleteReading( undef, - $name . ' ' . 'fc[' . $forecastLimit . '-99]_.*' ); + $name . ' ' . 'fc[' . $forecastLimit . '-9][0-9]?_.*' ); $forecastLimit = $forecastLimitNoForecast if ( !$forecastConfig->{hourly} ); CommandDeleteReading( undef, - $name . ' ' . 'hfc[' . $forecastLimit . '-99]_.*' ); + $name . ' ' . 'hfc[' . $forecastLimit . '-9][0-9]?_.*' ); return; }