From 9d8e9ce730d0770b075b58e2ee324d6e4747ebe1 Mon Sep 17 00:00:00 2001 From: HomeAuto_User <> Date: Thu, 5 Apr 2018 18:29:17 +0000 Subject: [PATCH] 88_xs1Bridge: fixed blacklist option (Forum #790923) git-svn-id: https://svn.fhem.de/fhem/trunk@16556 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/88_xs1Bridge.pm | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 0ef3570ab..f23a4c098 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_xs1Bridge: blacklist option (forum #790923) - bugfix: 49_SSCam: V3.8.3, fix of version 3.8.2 - change: 49_SSCam: V3.8.2, internal codereview, minor fixes - feature: 73_GardenaSmartBridge/74_GardenaSmartDevice: rewrite parts of diff --git a/fhem/FHEM/88_xs1Bridge.pm b/fhem/FHEM/88_xs1Bridge.pm index eacfe7bb6..43a0dc92c 100644 --- a/fhem/FHEM/88_xs1Bridge.pm +++ b/fhem/FHEM/88_xs1Bridge.pm @@ -87,7 +87,7 @@ sub xs1Bridge_Define($$) { $hash->{STATE} = "Initialized"; ## Der Status des Modules nach Initialisierung. $hash->{TIME} = time(); ## Zeitstempel, derzeit vom anlegen des Moduls - $hash->{VERSION} = "1.20"; ## Version + $hash->{VERSION} = "1.21"; ## Version $hash->{BRIDGE} = 1; # Attribut gesetzt @@ -176,8 +176,14 @@ sub xs1Bridge_Attr(@) { } ### Blacklist - Aktor / Sensor ### }elsif ($attrName eq "xs1_blackl_aktor") { ## Handling xs1_blackl_aktor - Log3 $name, 4, "$typ: Attribut xs1_blackl_aktor $attrValue"; + if ($attrValue < 1 || $attrValue > 64) { ## Value only 1 to 64 + return "Value must be 1 to 64"; + } + Log3 $name, 4, "$typ: Attribut xs1_blackl_aktor $attrValue"; }elsif ($attrName eq "xs1_blackl_sensor") { ## Handling xs1_blackl_sensor + if ($attrValue < 1 || $attrValue > 64) { ## Value only 1 to 64 + return "Value must be 1 to 64"; + } Log3 $name, 4, "$typ: Attribut xs1_blackl_sensor $attrValue"; } } @@ -333,7 +339,7 @@ sub xs1Bridge_GetUpDate() { foreach my $f ( @array ) { $i3++; - $xs1_id = $f->{"id"}; + $xs1_id = $i3; #### Test ob Aktoren / Sensoren auf xs1_blackl if ($f->{"type"} ne "disabled" && is_in_array($hash,$xs1_id,$i) == 0) {