From f025c45d4d86f4481b50669ad17c7358aa39ba4f Mon Sep 17 00:00:00 2001 From: betateilchen <> Date: Fri, 18 Jan 2019 18:06:55 +0000 Subject: [PATCH] configDB.pm: minor changes for FUUID git-svn-id: https://svn.fhem.de/fhem/trunk@18319 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/configDB.pm | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/fhem/configDB.pm b/fhem/configDB.pm index 92e95db65..e531e4361 100644 --- a/fhem/configDB.pm +++ b/fhem/configDB.pm @@ -143,6 +143,7 @@ # 2018-09-08 - change remove base64 migration functions # # 2019-01-17 - added support for device specific uuid (setuuid) +# 2019-01-18 - changed use GetDefAndAttr() # ############################################################################## =cut @@ -158,6 +159,7 @@ use MIME::Base64; # Forward declarations for functions in fhem.pl # sub AnalyzeCommandChain($$;$); +sub GetDefAndAttr($;$); sub Log($$); sub Log3($$$); sub createUniqueId(); @@ -462,28 +464,7 @@ sub cfgDB_SaveCfg(;$) { next; } - if($d ne "global") { - my $def = $defs{$d}{DEF}; - if(defined($def)) { - $def =~ s/;/;;/g; - $def =~ s/\n/\\\n/g; - } else { - $def = ""; - } - push @rowList, "define $d $defs{$d}{TYPE} $def"; - push @rowList, "setuuid $d $defs{$d}{FUUID}" if (defined($defs{$d}{FUUID}) && $defs{$d}{FUUID}); - } - - foreach my $a (sort { - return -1 if($a eq "userattr"); # userattr must be first - return 1 if($b eq "userattr"); - return $a cmp $b; - } keys %{$attr{$d}}) { - next if (grep { $_ eq "$d:$a" } @dontSave); - my $val = $attr{$d}{$a}; - $val =~ s/;/;;/g; - push @rowList, "attr $d $a $val"; - } + push (@rowList, GetDefAndAttr($d,1)); }