From 564f2dc7023b18c1912ec94a0db4f9de5ba410e2 Mon Sep 17 00:00:00 2001 From: fhemzap Date: Sat, 16 Jan 2016 17:30:43 +0000 Subject: [PATCH] HMCCUCHN: Fixed multiple datapoints query git-svn-id: https://svn.fhem.de/fhem/trunk@10528 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/HMCCU/88_HMCCUCHN.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fhem/contrib/HMCCU/88_HMCCUCHN.pm b/fhem/contrib/HMCCU/88_HMCCUCHN.pm index fae20b022..22dc6c727 100644 --- a/fhem/contrib/HMCCU/88_HMCCUCHN.pm +++ b/fhem/contrib/HMCCU/88_HMCCUCHN.pm @@ -80,6 +80,8 @@ sub HMCCUCHN_Define ($@) my $devtype = shift @a; my $devspec = shift @a; + return "Invalid or unknown CCU channel name or address" if (! HMCCU_IsValidDevice ($devspec)); + if ($devspec =~ /^(.+)\.([A-Z]{3,3}[0-9]{7,7}:[0-9]+)$/) { # CCU Channel address with interface $hash->{ccuif} = $1; @@ -116,6 +118,7 @@ sub HMCCUCHN_Define ($@) AssignIoPort ($hash); readingsSingleUpdate ($hash, "state", "Initialized", 1); + $hash->{ccudevstate} = 'Active'; return undef; } @@ -328,7 +331,8 @@ sub HMCCUCHN_SetError ($$) my %errlist = ( -1 => 'Channel name or address invalid', -2 => 'Execution of CCU script failed', - -3 => 'Cannot detect IO device' + -3 => 'Cannot detect IO device', + -4 => 'Device deleted in CCU' ); if (exists ($errlist{$text})) {