From 8a9a9208d3a951488b1b2cc5c9209b6d2e4f4162 Mon Sep 17 00:00:00 2001 From: fhemzap <> Date: Sun, 4 Oct 2015 12:28:26 +0000 Subject: [PATCH] HMCCUDEV: Added variable set commands, readony devices, client initiated updates git-svn-id: https://svn.fhem.de/fhem/trunk@9366 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/HMCCU/88_HMCCUDEV.pm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) 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. +