From 970ba1700328d59b1868dad082bc8029e9022347 Mon Sep 17 00:00:00 2001 From: fhemzap Date: Sat, 16 Jan 2016 17:30:11 +0000 Subject: [PATCH] HMCCUDEV: Fixed multiple datapoints query git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@10527 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/HMCCU/88_HMCCUDEV.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fhem/contrib/HMCCU/88_HMCCUDEV.pm b/fhem/contrib/HMCCU/88_HMCCUDEV.pm index f414a3555..ba137776c 100644 --- a/fhem/contrib/HMCCU/88_HMCCUDEV.pm +++ b/fhem/contrib/HMCCU/88_HMCCUDEV.pm @@ -84,6 +84,8 @@ sub HMCCUDEV_Define ($@) my $devtype = shift @a; my $devspec = shift @a; + return "Invalid or unknown CCU device name or address" if (! HMCCU_IsValidDevice ($devspec)); + if ($devspec =~ /^(.+)\.([A-Z]{3,3}[0-9]{7,7})$/) { # CCU Device address with interface $hash->{ccuif} = $1; @@ -134,6 +136,7 @@ sub HMCCUDEV_Define ($@) AssignIoPort ($hash); readingsSingleUpdate ($hash, "state", "Initialized", 1); + $hash->{ccudevstate} = 'Active'; return undef; } @@ -407,7 +410,8 @@ sub HMCCUDEV_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})) {