diff --git a/fhem/contrib/HMCCU/88_HMCCUDEV.pm b/fhem/contrib/HMCCU/88_HMCCUDEV.pm index 02935f68e..05a225d72 100644 --- a/fhem/contrib/HMCCU/88_HMCCUDEV.pm +++ b/fhem/contrib/HMCCU/88_HMCCUDEV.pm @@ -10,13 +10,14 @@ # ################################################################ # -# define HMCCUDEV [ { readonly | } ] +# define HMCCUDEV [ readonly ] # # set datapoint . # set devstate # set # # get datapoint . +# get update # # attr ccureadings { 0 | 1 } # attr statechannel @@ -129,6 +130,9 @@ sub HMCCUDEV_Set ($@) if (!defined ($hash->{IODev})) { return HMCCUDEV_SetError ($hash, "No IO device defined"); } + if ($hash->{statevals} eq 'readonly') { + return undef; + } my $statechannel = AttrVal ($name, "statechannel", ''); my $stateval = AttrVal ($name, "stateval", ''); @@ -232,8 +236,15 @@ sub HMCCUDEV_Get ($@) return undef; } + elsif ($opt eq 'update') { + foreach my $r (keys %{$hash->{READINGS}}) { + if ($r =~ /^$ccudev:[0-9]\..+/) { + HMCCU_Get ($hmccu_hash, $hmccu_name, 'datapoint', $r); + } + } + } else { - return "HMCCUDEV: Unknown argument $opt, choose one of datapoint"; + return "HMCCUDEV: Unknown argument $opt, choose one of datapoint update:noArg"; } } @@ -313,6 +324,10 @@ sub HMCCUDEV_SetError ($$)
Get state of a CCU device datapoint.
+
  • get <Name> update +
    + Update current readings matching CCU device name. +