2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-13 17:26:34 +00:00

HMCCUCHN: CCU access modes State and Value

git-svn-id: https://svn.fhem.de/fhem/trunk@10504 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
fhemzap 2016-01-14 19:32:46 +00:00
parent 5aab69ddd0
commit b38225a9e7

View File

@ -4,7 +4,7 @@
# #
# $Id:$ # $Id:$
# #
# Version 2.4 # Version 2.5
# #
# (c) 2015 zap (zap01 <at> t-online <dot> de) # (c) 2015 zap (zap01 <at> t-online <dot> de)
# #
@ -61,7 +61,7 @@ sub HMCCUCHN_Initialize ($)
$hash->{GetFn} = "HMCCUCHN_Get"; $hash->{GetFn} = "HMCCUCHN_Get";
$hash->{AttrFn} = "HMCCUCHN_Attr"; $hash->{AttrFn} = "HMCCUCHN_Attr";
$hash->{AttrList} = "IODev ccureadingfilter ccureadingformat:name,address,datapoint ccureadings:0,1 ccustate statedatapoint statevals substitute stripnumber:0,1,2 loglevel:0,1,2,3,4,5,6 ". $readingFnAttributes; $hash->{AttrList} = "IODev ccureadingfilter ccureadingformat:name,address,datapoint ccureadings:0,1 ccustate ccuget:State,Value statedatapoint statevals substitute stripnumber:0,1,2 loglevel:0,1,2,3,4,5,6 ". $readingFnAttributes;
} }
##################################### #####################################
@ -288,7 +288,12 @@ sub HMCCUCHN_Get ($@)
return $ccureadings ? undef : $result; return $ccureadings ? undef : $result;
} }
elsif ($opt eq 'update') { elsif ($opt eq 'update') {
$rc = HMCCU_GetUpdate ($hash, $hash->{ccuaddr}); my $ccuget = shift @a;
$ccuget = 'Attr' if (!defined ($ccuget));
if ($ccuget !~ /^(Attr|State|Value)$/) {
return HMCCUCHN_SetError ($hash, "Usage: get $name update [{'State'|'Value'}]");
}
$rc = HMCCU_GetUpdate ($hash, $hash->{ccuaddr}, $ccuget);
return HMCCUCHN_SetError ($hash, $rc) if ($rc < 0); return HMCCUCHN_SetError ($hash, $rc) if ($rc < 0);
return undef; return undef;
} }
@ -422,8 +427,7 @@ sub HMCCUCHN_SetError ($$)
<br/> <br/>
Get description of configuration parameters of CCU channel. Get description of configuration parameters of CCU channel.
</li><br/> </li><br/>
<li>get &lt;name&gt; update <li>get &lt;name&gt; update [{'State'|'Value'}]<br/>
<br/>
Update all datapoints / readings of channel. Update all datapoints / readings of channel.
</li> </li>
</ul> </ul>
@ -433,28 +437,26 @@ sub HMCCUCHN_SetError ($$)
<b>Attributes</b><br/> <b>Attributes</b><br/>
<br/> <br/>
<ul> <ul>
<li>ccureadings &lt;0 | 1&gt; <li>ccuget &lt;State | Value&gt;<br/>
<br/> Set read access method for CCU channel datapoints. Method 'State' is slower than 'Value' because
If set to 1 values read from CCU will be stored as readings. each request is sent to the device. With method 'Value' only CCU is queried. Default is 'Value'.
</li><br/> </li><br/>
<li>ccureadingfilter &lt;datapoint-expr&gt; <li>ccureadings &lt;0 | 1&gt;<br/>
<br/> If set to 1 values read from CCU will be stored as readings. Default is 1.
Only datapoints matching specified expression are stored as
readings.
</li><br/> </li><br/>
<li>statedatapoint &lt;datapoint&gt; <li>ccureadingfilter &lt;datapoint-expr&gt;<br/>
<br/> Only datapoints matching specified expression are stored as readings.
</li><br/>
<li>statedatapoint &lt;datapoint&gt;<br/>
Set datapoint for devstate commands. Set datapoint for devstate commands.
</li><br/> </li><br/>
<li>statevals &lt;text&gt;:&lt;text&gt;[,...] <li>statevals &lt;text&gt;:&lt;text&gt;[,...]<br/>
<br/>
Define substitution for set commands values. The parameters &lt;text&gt; Define substitution for set commands values. The parameters &lt;text&gt;
are available as set commands. Example:<br/> are available as set commands. Example:<br/>
<code>attr my_switch statevals on:true,off:false</code><br/> <code>attr my_switch statevals on:true,off:false</code><br/>
<code>set my_switch on</code> <code>set my_switch on</code>
</li><br/> </li><br/>
<li>substitude &lt;subst-rule&gt;[;...] <li>substitude &lt;subst-rule&gt;[;...]<br/>
<br/>
Define substitions for reading values. Substitutions for parfile values must Define substitions for reading values. Substitutions for parfile values must
be specified in parfiles. Syntax of subst-rule is<br/><br/> be specified in parfiles. Syntax of subst-rule is<br/><br/>
[datapoint!]&lt;regexp1&gt;:&lt;text1&gt;[,...] [datapoint!]&lt;regexp1&gt;:&lt;text1&gt;[,...]