mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-28 11:01:59 +00:00
HMCCUDEV: Added experimental attribute controldatapoint
git-svn-id: https://svn.fhem.de/fhem/trunk@10585 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
63f175730f
commit
a0973caceb
@ -64,7 +64,7 @@ sub HMCCUDEV_Initialize ($)
|
|||||||
$hash->{GetFn} = "HMCCUDEV_Get";
|
$hash->{GetFn} = "HMCCUDEV_Get";
|
||||||
$hash->{AttrFn} = "HMCCUDEV_Attr";
|
$hash->{AttrFn} = "HMCCUDEV_Attr";
|
||||||
|
|
||||||
$hash->{AttrList} = "IODev ccureadingfilter ccureadingformat:name,address ccureadings:0,1 ccustate ccuget:State,Value statevals substitute statechannel statedatapoint stripnumber:0,1,2 loglevel:0,1,2,3,4,5,6 ". $readingFnAttributes;
|
$hash->{AttrList} = "IODev ccureadingfilter ccureadingformat:name,address ccureadings:0,1 ccustate ccuget:State,Value statevals substitute statechannel statedatapoint controldatapoint stripnumber:0,1,2 loglevel:0,1,2,3,4,5,6 ". $readingFnAttributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
@ -195,6 +195,7 @@ sub HMCCUDEV_Set ($@)
|
|||||||
my $statechannel = AttrVal ($name, "statechannel", '');
|
my $statechannel = AttrVal ($name, "statechannel", '');
|
||||||
my $statedatapoint = AttrVal ($name, "statedatapoint", 'STATE');
|
my $statedatapoint = AttrVal ($name, "statedatapoint", 'STATE');
|
||||||
my $statevals = AttrVal ($name, "statevals", '');
|
my $statevals = AttrVal ($name, "statevals", '');
|
||||||
|
my $controldatapoint = AttrVal ($name, "controldatapoint", '');
|
||||||
|
|
||||||
my $hmccu_hash = $hash->{IODev};
|
my $hmccu_hash = $hash->{IODev};
|
||||||
my $hmccu_name = $hash->{IODev}->{NAME};
|
my $hmccu_name = $hash->{IODev}->{NAME};
|
||||||
@ -224,6 +225,16 @@ sub HMCCUDEV_Set ($@)
|
|||||||
HMCCU_SetState ($hash, "OK");
|
HMCCU_SetState ($hash, "OK");
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
elsif ($opt eq 'control') {
|
||||||
|
return HMCCUDEV_SetError ($hash, "Attribute control datapoint not set") if ($controldatapoint eq '');
|
||||||
|
my $objvalue = shift @a;
|
||||||
|
my $objname = $hash->{ccuif}.'.'.$hash->{ccuaddr}.':'.$controldatapoint;
|
||||||
|
$rc = HMCCU_SetDatapoint ($hash, $objname, $objvalue);
|
||||||
|
return HMCCUDEV_SetError ($hash, $rc) if ($rc < 0);
|
||||||
|
|
||||||
|
HMCCU_SetState ($hash, "OK");
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
elsif ($opt =~ /^($hash->{statevals})$/) {
|
elsif ($opt =~ /^($hash->{statevals})$/) {
|
||||||
my $cmd = $1;
|
my $cmd = $1;
|
||||||
my $objvalue = ($cmd ne 'devstate') ? $cmd : join ('%20', @a);
|
my $objvalue = ($cmd ne 'devstate') ? $cmd : join ('%20', @a);
|
||||||
@ -258,7 +269,7 @@ sub HMCCUDEV_Set ($@)
|
|||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
my $retmsg = "HMCCUDEV: Unknown argument $opt, choose one of config datapoint";
|
my $retmsg = "HMCCUDEV: Unknown argument $opt, choose one of config control datapoint";
|
||||||
return undef if ($hash->{statevals} eq 'readonly');
|
return undef if ($hash->{statevals} eq 'readonly');
|
||||||
|
|
||||||
if ($statechannel ne '') {
|
if ($statechannel ne '') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user