From 1ff1e5db8c99b10dacfe6a720e0aa5cc416d8ed3 Mon Sep 17 00:00:00 2001 From: LeonGaultier Date: Sun, 14 Nov 2021 13:13:56 +0000 Subject: [PATCH] 73_AutoShuttersControl: Fix uninitialized value within %charHash in substitution iterator git-svn-id: https://svn.fhem.de/fhem/trunk@25223 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 ++ fhem/FHEM/73_AutoShuttersControl.pm | 2 +- fhem/lib/FHEM/Automation/ShuttersControl.pm | 10 +++++----- .../FHEM/Automation/ShuttersControl/Helper.pm | 19 ------------------- 4 files changed, 8 insertions(+), 25 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 63ec83dde..80b6991e3 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - bugfix: 73_AutoShuttersControl: Fix uninitialized value within %charHash + in substitution iterator - bugfix: 88_HMCCU: Fixed ePaper and BSL bugs - bugfix: 88_HMCCU: Fixed some bugs - bugfix: 73_km200: Allowing port behind IP address diff --git a/fhem/FHEM/73_AutoShuttersControl.pm b/fhem/FHEM/73_AutoShuttersControl.pm index 21c079d77..0dc5c838c 100644 --- a/fhem/FHEM/73_AutoShuttersControl.pm +++ b/fhem/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/fhem/lib/FHEM/Automation/ShuttersControl.pm b/fhem/lib/FHEM/Automation/ShuttersControl.pm index cbb6d8add..b53a2809c 100644 --- a/fhem/lib/FHEM/Automation/ShuttersControl.pm +++ b/fhem/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/fhem/lib/FHEM/Automation/ShuttersControl/Helper.pm b/fhem/lib/FHEM/Automation/ShuttersControl/Helper.pm index 80cb8ca40..a6ff9168d 100644 --- a/fhem/lib/FHEM/Automation/ShuttersControl/Helper.pm +++ b/fhem/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 ); }