From d6cb059eaf8fb80fd3eed829998725917e7cbeb3 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Sun, 14 Nov 2021 13:44:35 +0100 Subject: [PATCH] closed: #68 fix bug PERL WARNING: Use of uninitialized value within %charHash in substitution iterator at lib/FHEM/Automation/ShuttersControl/Helper.pm line 1021 is FHEM startup. --- FHEM/73_AutoShuttersControl.pm | 2 +- controls_AutoShuttersControl.txt | 8 ++++---- lib/FHEM/Automation/ShuttersControl.pm | 10 +++++----- lib/FHEM/Automation/ShuttersControl/Helper.pm | 19 ------------------- 4 files changed, 10 insertions(+), 29 deletions(-) diff --git a/FHEM/73_AutoShuttersControl.pm b/FHEM/73_AutoShuttersControl.pm index 21c079d..0dc5c83 100644 --- a/FHEM/73_AutoShuttersControl.pm +++ b/FHEM/73_AutoShuttersControl.pm @@ -1465,7 +1465,7 @@ __END__ ], "release_status": "stable", "license": "GPL_2", - "version": "v0.10.18", + "version": "v0.10.19", "author": [ "Marko Oldenburg " ], diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index aea333f..ab4e4ba 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -1,11 +1,11 @@ -UPD 2021-10-27_09:58:32 115685 FHEM/73_AutoShuttersControl.pm -UPD 2021-10-27_09:48:09 75254 lib/FHEM/Automation/ShuttersControl.pm +UPD 2021-11-14_13:42:55 115685 FHEM/73_AutoShuttersControl.pm +UPD 2021-11-14_13:40:41 75264 lib/FHEM/Automation/ShuttersControl.pm UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm UPD 2021-10-24_07:33:53 31900 lib/FHEM/Automation/ShuttersControl/Shutters.pm UPD 2021-10-09_07:12:54 25333 lib/FHEM/Automation/ShuttersControl/Shading.pm -UPD 2021-10-27_08:50:46 110681 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm -UPD 2021-10-09_07:12:54 40628 lib/FHEM/Automation/ShuttersControl/Helper.pm +UPD 2021-11-10_20:11:14 110681 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm +UPD 2021-11-14_13:37:27 40094 lib/FHEM/Automation/ShuttersControl/Helper.pm UPD 2021-10-09_07:12:54 2173 lib/FHEM/Automation/ShuttersControl/Window.pm UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm UPD 2021-10-09_07:12:54 7249 lib/FHEM/Automation/ShuttersControl/Dev/Readings.pm diff --git a/lib/FHEM/Automation/ShuttersControl.pm b/lib/FHEM/Automation/ShuttersControl.pm index cbb6d8a..b53a280 100644 --- a/lib/FHEM/Automation/ShuttersControl.pm +++ b/lib/FHEM/Automation/ShuttersControl.pm @@ -775,11 +775,11 @@ sub WriteReadingsShuttersList { readingsBulkUpdate( $hash, 'room_' - . makeReadingName( AttrVal( $shuttersDev, 'room', 'unsorted' ) ), + . ::makeReadingName( AttrVal( $shuttersDev, 'room', 'unsorted' ) ), ReadingsVal( $name, 'room_' - . makeReadingName( + . ::makeReadingName( AttrVal( $shuttersDev, 'room', 'unsorted' ) ), '' @@ -791,7 +791,7 @@ sub WriteReadingsShuttersList { ReadingsVal( $name, 'room_' - . makeReadingName( + . ::makeReadingName( AttrVal( $shuttersDev, 'room', 'unsorted' ) ), 'none' @@ -801,14 +801,14 @@ sub WriteReadingsShuttersList { readingsBulkUpdate( $hash, 'room_' - . makeReadingName( AttrVal( $shuttersDev, 'room', 'unsorted' ) ), + . ::makeReadingName( AttrVal( $shuttersDev, 'room', 'unsorted' ) ), $shuttersDev ) if ( ReadingsVal( $name, 'room_' - . makeReadingName( + . ::makeReadingName( AttrVal( $shuttersDev, 'room', 'unsorted' ) ), 'none' diff --git a/lib/FHEM/Automation/ShuttersControl/Helper.pm b/lib/FHEM/Automation/ShuttersControl/Helper.pm index 80cb8ca..a6ff916 100644 --- a/lib/FHEM/Automation/ShuttersControl/Helper.pm +++ b/lib/FHEM/Automation/ShuttersControl/Helper.pm @@ -994,25 +994,6 @@ sub IsAfterShuttersManualBlocking { else { return 1 } } -sub makeReadingName { - my ($rname) = shift; - my %charHash = ( - chr(0xe4) => "ae", # ä - chr(0xc4) => "Ae", # Ä - chr(0xfc) => "ue", # ü - chr(0xdc) => "Ue", # Ü - chr(0xf6) => "oe", # ö - chr(0xd6) => "Oe", # Ö - chr(0xdf) => "ss" # ß - ); - my $charHashkeys = join( "", keys(%charHash) ); - - return $rname if ( $rname =~ m{^\./}xms ); - $rname =~ s/([$charHashkeys])/$charHash{$1}/xgi; - $rname =~ s/[^a-z0-9._\-\/]/_/xgi; - return $rname; -} - sub IsWe { return main::IsWe( shift, shift ); }