2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-15 22:26:04 +00:00

fhem.pl: attribute exclusion list for GetDefAndAttr, by betateilchen (Forum #95902)

git-svn-id: https://svn.fhem.de/fhem/trunk@18317 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2019-01-18 17:06:18 +00:00
parent 03c5f3d8f8
commit 87f4674162

View File

@ -65,6 +65,7 @@ sub FileRead($);
sub FileWrite($@);
sub FmtDateTime($);
sub FmtTime($);
sub GetDefAndAttr($;$);
sub GetLogLevel(@);
sub GetTimeSpec($);
sub GetType($;$);
@ -1619,13 +1620,15 @@ GetDefAndAttr($;$)
push @ret, "setuuid $d $defs{$d}{FUUID}"
if($dumpFUUID && defined($defs{$d}{FUUID}) && $defs{$d}{FUUID});
# exclude attributes, format <deviceName>:<attrName>, space separated list
my @dontSave = qw(configdb:rescue configdb:nostate configdb:loadversion
global:configfile global:version);
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($d eq "global" &&
($a eq "configfile" || $a eq "version"));
next if (grep { $_ eq "$d:$a" } @dontSave);
my $val = $attr{$d}{$a};
$val =~ s/;/;;/g;
$val =~ s/\n/\\\n/g;