From 6e8848d4602f8f54d16ce83e399750e2c9ed7f42 Mon Sep 17 00:00:00 2001
From: zap <>
Date: Sat, 11 May 2019 15:18:23 +0000
Subject: [PATCH] HMCCU: Disable initial device update
git-svn-id: https://svn.fhem.de/fhem/trunk@19373 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/CHANGED | 1 +
fhem/FHEM/88_HMCCU.pm | 24 ++++++++++-------
fhem/FHEM/88_HMCCURPCPROC.pm | 52 ++++++++++++++++++++++++++++++++++--
3 files changed, 66 insertions(+), 11 deletions(-)
diff --git a/fhem/CHANGED b/fhem/CHANGED
index 3aaecdcc8..735d60ea7 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
+ - bugfix: 88_HMCCU: Flag for disabling initial device update
- bugfix: 10_MYSENSORS_DEVICE: prevent fhem crashing by ack timeout
at higher verobse levels
- change: 98_Heating_Control.pm will be removed soon. Users will need to
diff --git a/fhem/FHEM/88_HMCCU.pm b/fhem/FHEM/88_HMCCU.pm
index 855bf3e55..2a9d2a553 100755
--- a/fhem/FHEM/88_HMCCU.pm
+++ b/fhem/FHEM/88_HMCCU.pm
@@ -4,7 +4,7 @@
#
# $Id$
#
-# Version 4.3.014
+# Version 4.3.015
#
# Module for communication between FHEM and Homematic CCU2/3.
#
@@ -52,7 +52,7 @@ my %HMCCU_CUST_CHN_DEFAULTS;
my %HMCCU_CUST_DEV_DEFAULTS;
# HMCCU version
-my $HMCCU_VERSION = '4.3.014';
+my $HMCCU_VERSION = '4.3.015';
# Constants and default values
my $HMCCU_MAX_IOERRORS = 100;
@@ -2639,7 +2639,10 @@ sub HMCCU_SetRPCState ($@)
my $st = $hash->{hmccu}{interfaces}{$i}{state};
$stc{$st}++ if (exists ($stc{$st}));
if ($hash->{hmccu}{interfaces}{$i}{manager} eq 'HMCCU') {
- $filter = defined ($filter) ? "$filter|$i" : $i;
+ my $rpcFlags = AttrVal ($hash->{hmccu}{interfaces}{$i}{device}, 'ccuflags', 'null');
+ if ($rpcFlags !~ /noInitialUpdate/) {
+ $filter = defined ($filter) ? "$filter|$i" : $i;
+ }
}
}
@@ -2659,7 +2662,7 @@ sub HMCCU_SetRPCState ($@)
DoTrigger ($name, "RPC server $rpcstate");
if ($rpcstate eq 'running') {
my ($c_ok, $c_err) = HMCCU_UpdateClients ($hash, '.*', 'Attr', 0, $filter);
- HMCCU_Log ($hash, 2, "Updated devices. Success=$c_ok Failed=$c_err", undef);
+ HMCCU_Log ($hash, 2, "Updated devices for interface filter $filter. Success=$c_ok Failed=$c_err", undef);
}
}
}
@@ -6812,7 +6815,8 @@ sub HMCCU_RPCGetConfig ($$$$)
my $hmccu_hash = HMCCU_GetHash ($hash);
return (-3, $result) if (!defined ($hmccu_hash));
return (-4, $result) if ($type ne 'HMCCU' && $hash->{ccudevstate} eq 'deleted');
-
+
+ my $hmccuflags = HMCCU_GetFlags ($hmccu_hash->{NAME});
my $ccuflags = HMCCU_GetFlags ($name);
my $ccureadings = AttrVal ($name, 'ccureadings', $ccuflags =~ /noReadings/ ? 0 : 1);
my $readingformat = HMCCU_GetAttrReadingFormat ($hash, $hmccu_hash);
@@ -6834,7 +6838,7 @@ sub HMCCU_RPCGetConfig ($$$$)
if ($rpctype eq 'B') {
HMCCU_Trace ($hash, 2, $fnc, "Method=$method Addr=$addr Port=$port");
- if ($ccuflags =~ /(extrpc|procrpc)/) {
+ if ($hmccuflags =~ /(extrpc|procrpc)/) {
$res = HMCCURPCPROC_SendRequest ($rpchash, $method, $BINRPC_STRING, $addr,
$BINRPC_STRING, "MASTER");
}
@@ -6916,13 +6920,15 @@ sub HMCCU_RPCSetConfig ($$$)
my $name = $hash->{NAME};
my $type = $hash->{TYPE};
- my $ccuflags = HMCCU_GetFlags ($name);
my $addr;
my $res;
my $hmccu_hash = HMCCU_GetHash ($hash);
return -3 if (!defined ($hmccu_hash));
return -4 if ($type ne 'HMCCU' && $hash->{ccudevstate} eq 'deleted');
+
+ my $hmccuflags = HMCCU_GetFlags ($hmccu_hash->{NAME});
+ my $ccuflags = HMCCU_GetFlags ($name);
my ($int, $add, $chn, $dpt, $nam, $flags) = HMCCU_ParseObject ($hmccu_hash, $param,
$HMCCU_FLAG_FULLADDR);
@@ -6954,7 +6960,7 @@ sub HMCCU_RPCSetConfig ($$$)
$binpar{$e}{V} = $parref->{$e};
}
- if ($ccuflags =~ /(extrpc|procrpc)/) {
+ if ($hmccuflags =~ /(extrpc|procrpc)/) {
$res = HMCCURPCPROC_SendRequest ($rpchash, "putParamset", $BINRPC_STRING, $addr,
$BINRPC_STRING, "MASTER", $BINRPC_STRUCT, \%binpar);
}
@@ -8400,7 +8406,7 @@ sub HMCCU_CCURPC_ListDevicesCB ($$)
procrpc - Use external RPC server provided by module HMCCPRPCPROC. During first RPC
server start HMCCU will create a HMCCURPCPROC device for each interface confiugured
in attribute 'rpcinterface'
- reconnect - Automatically reconnect to CCU when events timeout occurred.
+ reconnect - Automatically reconnect to CCU when events timeout occurred.
Flags intrpc, extrpc and procrpc cannot be combined.