2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

10_ZWave.pm: parse get association result (Forum #43768)

git-svn-id: https://svn.fhem.de/fhem/trunk@9840 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-11-09 18:14:53 +00:00
parent 8707224425
commit 92f899a1cf

View File

@ -325,8 +325,7 @@ my %zwave_class = (
associationRequestAll => 'ZWave_associationRequest($hash,"")' },
get => { association => "02%02x",
associationGroups => "05" },
parse => { "..8503(..)(..)..(.*)" =>
'sprintf("assocGroup_%d:Max %d Nodes %d", hex($1), hex($2), hex($3))',
parse => { "..8503(..)(..)..(.*)" => 'ZWave_assocGroup($homeId,$1,$2,$3)',
"..8506(..)" => '"assocGroups:".hex($1)' },
init => { ORDER=>10, CMD=> '"set $NAME associationAdd 1 $CTRLID"' } },
VERSION => { id => '86',
@ -1872,6 +1871,19 @@ ZWave_sensorbinaryV2Parse($$)
":".$value;
}
sub
ZWave_assocGroup($$$$)
{
my ($homeId, $gId, $max, $nodes) = @_;
my %list = map { $defs{$_}{nodeIdHex} => $_ }
grep { $defs{$_}{homeId} && $defs{$_}{homeId} eq $homeId }
keys %defs;
$nodes = join(" ",
map { $list{$_} ? $list{$_} : "UNKNOWN_".hex($_); }
($nodes =~ m/../g));
return sprintf("assocGroup_%d:Max %d Nodes %s", hex($gId),hex($max), $nodes);
}
##############################################
# SECURITY (start)
##############################################