From fbd0a27bb2bb51bfddf1593e33029e79d108a97f Mon Sep 17 00:00:00 2001 From: fhemzap Date: Thu, 14 Jan 2016 19:32:46 +0000 Subject: [PATCH] HMCCUCHN: CCU access modes State and Value git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@10504 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/HMCCU/88_HMCCUCHN.pm | 54 ++++++++++++++++--------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/fhem/contrib/HMCCU/88_HMCCUCHN.pm b/fhem/contrib/HMCCU/88_HMCCUCHN.pm index 980d3544f..fae20b022 100644 --- a/fhem/contrib/HMCCU/88_HMCCUCHN.pm +++ b/fhem/contrib/HMCCU/88_HMCCUCHN.pm @@ -4,7 +4,7 @@ # # $Id:$ # -# Version 2.4 +# Version 2.5 # # (c) 2015 zap (zap01 t-online de) # @@ -61,7 +61,7 @@ sub HMCCUCHN_Initialize ($) $hash->{GetFn} = "HMCCUCHN_Get"; $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; } 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 undef; } @@ -422,8 +427,7 @@ sub HMCCUCHN_SetError ($$)
Get description of configuration parameters of CCU channel.
-
  • get <name> update -
    +
  • get <name> update [{'State'|'Value'}]
    Update all datapoints / readings of channel.
  • @@ -433,31 +437,29 @@ sub HMCCUCHN_SetError ($$) Attributes

      -
    • ccureadings <0 | 1> -
      - If set to 1 values read from CCU will be stored as readings. +
    • ccuget <State | Value>
      + Set read access method for CCU channel datapoints. Method 'State' is slower than 'Value' because + each request is sent to the device. With method 'Value' only CCU is queried. Default is 'Value'.

    • -
    • ccureadingfilter <datapoint-expr> -
      - Only datapoints matching specified expression are stored as - readings. +
    • ccureadings <0 | 1>
      + If set to 1 values read from CCU will be stored as readings. Default is 1.

    • -
    • statedatapoint <datapoint> -
      - Set datapoint for devstate commands. +
    • ccureadingfilter <datapoint-expr>
      + Only datapoints matching specified expression are stored as readings.

    • -
    • statevals <text>:<text>[,...] -
      - Define substitution for set commands values. The parameters <text> - are available as set commands. Example:
      - attr my_switch statevals on:true,off:false
      - set my_switch on +
    • statedatapoint <datapoint>
      + Set datapoint for devstate commands.

    • -
    • substitude <subst-rule>[;...] -
      - Define substitions for reading values. Substitutions for parfile values must - be specified in parfiles. Syntax of subst-rule is

      - [datapoint!]<regexp1>:<text1>[,...] +
    • statevals <text>:<text>[,...]
      + Define substitution for set commands values. The parameters <text> + are available as set commands. Example:
      + attr my_switch statevals on:true,off:false
      + set my_switch on +

    • +
    • substitude <subst-rule>[;...]
      + Define substitions for reading values. Substitutions for parfile values must + be specified in parfiles. Syntax of subst-rule is

      + [datapoint!]<regexp1>:<text1>[,...]