mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
MYSENSORS_DEVICE: fix attr setCommands
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@6807 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
b01922d2a9
commit
ca03e8be75
@ -256,14 +256,17 @@ sub Attr($$$$) {
|
||||
delete $hash->{sets}->{$set};
|
||||
}
|
||||
$hash->{setcommands} = {};
|
||||
if ($command eq "set" and defined $value) {
|
||||
if ($command eq "set" and $value) {
|
||||
foreach my $setCmd (split ("[, \t]+",$value)) {
|
||||
$setCmd =~ /^(.+):(.+_\d+):(.+)$/;
|
||||
$hash->{sets}->{$1}="";
|
||||
$hash->{setcommands}->{$1} = {
|
||||
var => $2,
|
||||
val => $3,
|
||||
};
|
||||
if ($setCmd =~ /^(.+):(.+):(.+)$/) {
|
||||
$hash->{sets}->{$1}="";
|
||||
$hash->{setcommands}->{$1} = {
|
||||
var => $2,
|
||||
val => $3,
|
||||
};
|
||||
} else {
|
||||
return "unparsable value in setCommands for $name: $setCmd";
|
||||
}
|
||||
}
|
||||
}
|
||||
last;
|
||||
|
Loading…
x
Reference in New Issue
Block a user