From a132bffdb827c2b169072da5b359488b8cee2c5f Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Sat, 25 May 2024 14:01:45 +0000 Subject: [PATCH] 70_PylonLowVoltage: replace Smartmatch Forum:#137776 git-svn-id: https://svn.fhem.de/fhem/trunk@28908 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/70_PylonLowVoltage.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/70_PylonLowVoltage.pm b/fhem/FHEM/70_PylonLowVoltage.pm index 7e0e8a5f7..3ee9cc196 100644 --- a/fhem/FHEM/70_PylonLowVoltage.pm +++ b/fhem/FHEM/70_PylonLowVoltage.pm @@ -67,8 +67,6 @@ eval "use Storable qw(freeze thaw);1;" or my $storabs = 'Storable'; use FHEM::SynoModules::SMUtils qw(moduleVersion); # Hilfsroutinen Modul #use Data::Dumper; -no if $] >= 5.017011, warnings => 'experimental::smartmatch'; - # Run before module compilation BEGIN { # Import from main:: @@ -122,6 +120,7 @@ BEGIN { # Versions History intern (Versions history by Heiko Maaz) my %vNotesIntern = ( + "0.2.6" => "25.05.2024 replace Smartmatch Forum:#137776 ", "0.2.5" => "02.04.2024 _callAnalogValue / _callAlarmInfo: integrate a Cell and Temperature Position counter ". "add specific Alarm readings ", "0.2.4" => "29.03.2024 avoid possible Illegal division by zero at line 1438 ", @@ -1540,10 +1539,10 @@ sub createReadings { for my $rdg (keys %{$readings}) { next if(!defined $readings->{$rdg}); - readingsBulkUpdate ($hash, $rdg, $readings->{$rdg}) if($success || $rdg ~~ @blackl); + readingsBulkUpdate ($hash, $rdg, $readings->{$rdg}) if($success || grep /^$rdg$/, @blackl); } - readingsEndUpdate ($hash, 1); + readingsEndUpdate ($hash, 1); return; } @@ -1560,7 +1559,7 @@ sub deleteReadingspec { my $readingspec = '^'.$spec.'$'; for my $reading ( grep { /$readingspec/x } keys %{$hash->{READINGS}} ) { - next if($reading ~~ @blackl); + next if(grep /^$reading$/, @blackl); readingsDelete ($hash, $reading); }