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