From d17278352b52d2d7a8073d7af39cce2267a5006c Mon Sep 17 00:00:00 2001 From: jamesgo <> Date: Wed, 9 Jan 2019 13:08:19 +0000 Subject: [PATCH] =?UTF-8?q?98=5FGAEBUS.pm=20:=20add=20support=20for=20Wolf?= =?UTF-8?q?/Kromschr=C3=B6der?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.fhem.de/fhem/trunk@18193 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_GAEBUS.pm | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/98_GAEBUS.pm b/fhem/FHEM/98_GAEBUS.pm index d6aa33fdd..480a1b68b 100644 --- a/fhem/FHEM/98_GAEBUS.pm +++ b/fhem/FHEM/98_GAEBUS.pm @@ -44,6 +44,8 @@ # 27.12.2016 : A.Goebel : fix handling if ebusctl reports "usage:" # 27.12.2016 : A.Goebel : fix scan removed from supported classes # 13.12.2017 : A.Goebel : add "+f" as additional ebus command to disable "-f" for this request +# 03.01.2019 : A.Goebel : fix mask tilde in set/get +# 03.01.2019 : A.Goebel : fix change regexp for parsing commands from "/^w$delimiter.{1,7}$delimiter.*/" to "/^w$delimiter[^$delimiter]{1,}$delimiter.*/" to support "feuerung" as class package main; @@ -188,6 +190,7 @@ GAEBUS_initParams ($) } #Log3 ($hash, 2, "GAEBUS Initialize: $setval:$allSetParamsForWriting"); } + } ##################################### @@ -257,6 +260,9 @@ GAEBUS_Set($@) my $type = shift @a; my $arg = join(" ", @a); + $type =~ s/\xe2\x88\xbc/~/g; + $arg =~ s/\xe2\x88\xbc/~/g; + #return "No $a[1] for dummies" if(IsDummy($name)); #Log3 ($hash, 3, "ebus1: reopen $name"); @@ -324,7 +330,7 @@ GAEBUS_Set($@) $readingname =~ s/:.*//; # only for "w" commands - if ($oneattr =~ /^w$delimiter.{1,7}$delimiter.*/ or $oneattr =~ /^w$delimiter.{1,7}install$delimiter.*/) + if ($oneattr =~ /^w$delimiter[^$delimiter]{1,}$delimiter.*/ or $oneattr =~ /^w$delimiter[^$delimiter]{1,}install$delimiter.*/) { unless ($readingname =~ /^\s*$/ or $readingname eq "1") { @@ -373,7 +379,7 @@ GAEBUS_Set($@) { foreach my $oneattr (sort keys %{$attr{$name}}) { - next unless ($oneattr =~ /^w.*$delimiter.{1,7}$delimiter.*$/ or $oneattr =~ /^w.*$delimiter.{1,7}install$delimiter.*$/); + next unless ($oneattr =~ /^w.*$delimiter[^$delimiter]{1,}$delimiter.*$/ or $oneattr =~ /^w.*$delimiter[^$delimiter]{1,}install$delimiter.*$/); my $readingname = $attr{$name}{$oneattr}; next if ($readingname ne $type); @@ -385,6 +391,7 @@ GAEBUS_Set($@) } + $actSetParams =~ s/~/∼/g; return "Unknown argument $type, choose one of " . $actSetParams if(!defined($sets{$type})); @@ -410,7 +417,7 @@ GAEBUS_Get($@) if ($type eq "ebusd_hex") { - Log3 ($hash, 4, "$name Set $type $arg"); + Log3 ($hash, 4, "$name Get $type $arg"); my $answer = GAEBUS_doEbusCmd ($hash, "h", "", "", "$arg", "", 0); @@ -472,7 +479,7 @@ GAEBUS_Get($@) $readingname =~ s/:.*//; # only for "r" commands - if ($oneattr =~ /^r$delimiter.{1,7}$delimiter.*/) + if ($oneattr =~ /^r$delimiter[^$delimiter]{1,}$delimiter.*/) { $readings{$readingname} = $readingcmdname; $readingsCmdaddon{$readingname} = $cmdaddon; @@ -532,6 +539,9 @@ GAEBUS_Get($@) # other read commands + if (defined($a[1])) { $a[1] =~ s/\xe2\x88\xbc/~/g }; + if (defined($a[2])) { $a[2] =~ s/\xe2\x88\xbc/~/g }; + if ($a[1] =~ /^[r]$delimiter/) { my $readingname = ""; @@ -548,6 +558,7 @@ GAEBUS_Get($@) # handle commands from %gets and show result from ebusd + $actGetParams =~ s/~/∼/g; return "Unknown argument $a[1], choose one of " . $actGetParams if(!defined($gets{$a[1]})); @@ -1188,7 +1199,7 @@ GAEBUS_GetUpdatesDoit($) foreach my $oneattr (keys %{$attr{$name}}) { # only for "r" commands - if ($oneattr =~ /^r$delimiter.{1,7}$delimiter.*/) + if ($oneattr =~ /^r$delimiter[^$delimiter]{1,}$delimiter.*/) { my ($readingnameX, $cmdaddon) = split (" ", $attr{$name}{$oneattr}, 2);