mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
HMCCU: Enhanced get channel command
git-svn-id: https://svn.fhem.de/fhem/trunk@10065 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
9687f80e5c
commit
44b9294cab
@ -21,6 +21,7 @@
|
||||
# get <name> channel <channel>[.<datapoint-expr>]
|
||||
#
|
||||
# attr <name> ccureadings { 0 | 1 }
|
||||
# attr <name> ccureadingformat { address | name }
|
||||
# attr <name> statechannel <channel>
|
||||
# attr <name> statedatapoint <datapoint>
|
||||
# attr <name> statevals <text1>:<subtext1>[,...]
|
||||
@ -56,7 +57,7 @@ sub HMCCUDEV_Initialize ($)
|
||||
$hash->{GetFn} = "HMCCUDEV_Get";
|
||||
$hash->{AttrFn} = "HMCCUDEV_Attr";
|
||||
|
||||
$hash->{AttrList} = "IODev ccureadingformat:name,address,datapoint ccureadings:0,1 statevals substitute statechannel statedatapoint loglevel:0,1,2,3,4,5,6 ". $readingFnAttributes;
|
||||
$hash->{AttrList} = "IODev ccureadingformat:name,address ccureadings:0,1 statevals substitute statechannel statedatapoint loglevel:0,1,2,3,4,5,6 ". $readingFnAttributes;
|
||||
}
|
||||
|
||||
#####################################
|
||||
@ -297,13 +298,16 @@ sub HMCCUDEV_Get ($@)
|
||||
return $ccureadings ? undef : $result;
|
||||
}
|
||||
elsif ($opt eq 'channel') {
|
||||
my $objname = shift @a;
|
||||
if (!defined ($objname) || $objname !~ /^[0-9]+/) {
|
||||
return HMCCUDEV_SetError ($hash, "Usage: get <name>> channel <channel-number>[.<datapoint-expr>]");
|
||||
my @chnlist;
|
||||
foreach my $objname (@a) {
|
||||
last if (!defined ($objname));
|
||||
return HMCCUDEV_SetError ($hash, "Invalid channel number: $objname") if ($objname !~ /^[0-9]+/);
|
||||
push (@chnlist, $hash->{ccuif}.'.'.$hash->{ccuaddr}.':'.$objname);
|
||||
}
|
||||
if (@chnlist == 0) {
|
||||
return HMCCUDEV_SetError ($hash, "Usage: get $name channel {channel-number}[.{datapoint-expr}] [...]");
|
||||
}
|
||||
|
||||
$objname = $hash->{ccuif}.'.'.$hash->{ccuaddr}.':'.$objname;
|
||||
my @chnlist = ($objname);
|
||||
($rc, $result) = HMCCU_GetChannel ($hash, \@chnlist);
|
||||
return HMCCUDEV_SetError ($hash, $rc) if ($rc < 0);
|
||||
return $ccureadings ? undef : $result;
|
||||
@ -432,6 +436,10 @@ sub HMCCUDEV_SetError ($$)
|
||||
<br/>
|
||||
If set to 1 values read from CCU will be stored as readings.
|
||||
</li><br/>
|
||||
<li>ccureadingformat <address | name>
|
||||
<br/>
|
||||
Set format of readings. Default is 'name'.
|
||||
</li><br/>
|
||||
<li>statechannel <channel-number>
|
||||
<br/>
|
||||
Channel for setting device state by devstate command.
|
||||
|
Loading…
x
Reference in New Issue
Block a user