mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
fhem.pl: delFromDevAttrList from CoolTux (Forum #90698)
git-svn-id: https://svn.fhem.de/fhem/trunk@17235 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
1c6a463f3a
commit
e7eda90b79
18
fhem/fhem.pl
18
fhem/fhem.pl
@ -3958,6 +3958,24 @@ addToDevAttrList($$)
|
||||
$attr{$dev}{userattr} = join(" ", sort keys %hash);
|
||||
}
|
||||
|
||||
# The counterpart: delete it.
|
||||
sub
|
||||
delFromDevAttrList($$)
|
||||
{
|
||||
my ($dev,$arg) = @_;
|
||||
|
||||
my $ua = $attr{$dev}{userattr};
|
||||
$ua = "" if(!$ua);
|
||||
my %hash = map { ($_ => 1) }
|
||||
grep { " $arg " !~ m/ $_ / }
|
||||
split(" ", "$ua $arg");
|
||||
$attr{$dev}{userattr} = join(" ", sort keys %hash);
|
||||
delete $attr{$dev}{userattr}
|
||||
if(!keys %hash && defined($attr{$dev}{userattr}));
|
||||
map { delete $attr{$dev}{$_} } split(" ", $arg);
|
||||
}
|
||||
|
||||
|
||||
sub
|
||||
addToAttrList($)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user