From 7a7eef9eb7c4a6a263e89a9cd3464ffd988c9fed Mon Sep 17 00:00:00 2001 From: viegener <> Date: Tue, 28 Apr 2020 10:19:13 +0000 Subject: [PATCH] 10_SOMFY: FIX: hex value warning for rollcode / empty ioTypes git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@21792 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/10_SOMFY.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/FHEM/10_SOMFY.pm b/FHEM/10_SOMFY.pm index 419defcbb..807eeea4e 100644 --- a/FHEM/10_SOMFY.pm +++ b/FHEM/10_SOMFY.pm @@ -76,6 +76,10 @@ # - new attr autoStoreRollingCode - store rc in uniqueID # - store rolling code in uniqueid based on addr # - ensure largest rollingcode (either reading or unqieid is used) +# - FIX: hex value warning for rollcode +# - FIX: allow empty ioTypes for testing +# +# # ############################################################################### # @@ -1068,7 +1072,10 @@ sub SOMFY_getRollCode($) if ( AttrVal( $name, "autoStoreRollingCode", 0 ) ) { my $storeRC = uc( SOMFY_readRollCode( $hash ) ); $storeRC = "0000" if ( $storeRC !~ /[0-9a-f]{4}/ ); - if ( $storeRC > $rollingcode ) { + my $storeDec = hex( $storeRC ); + my $rollDec = hex( $rollingcode ); + + if ( $storeDec > $rollDec ) { $rollingcode = $storeRC; } } @@ -1591,6 +1598,7 @@ sub SOMFY_SendCommand($@) my $io = $hash->{IODev}; my $ioType = $io->{TYPE}; + $ioType = "" if ( ! defined( $ioType ) ); return $ret if(IsIgnored($name)); return $ret if(IsDisabled($name));