From 01e06609030d480368adb550f0d19a484b090e61 Mon Sep 17 00:00:00 2001 From: wuehler <> Date: Sat, 23 Jun 2018 11:22:34 +0000 Subject: [PATCH] 74_Unifi: Minor bugfix in notify-function git-svn-id: https://svn.fhem.de/fhem/trunk@16900 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/74_Unifi.pm | 7 +++++-- fhem/FHEM/74_UnifiSwitch.pm | 12 ++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/fhem/FHEM/74_Unifi.pm b/fhem/FHEM/74_Unifi.pm index e23e08fbe..62f3eb67a 100644 --- a/fhem/FHEM/74_Unifi.pm +++ b/fhem/FHEM/74_Unifi.pm @@ -31,6 +31,8 @@ # V 3.0.1 # - feature: 74_Unifi: new reading UC_newClients for new clients # - feature: 74_Unifi: block clients by mac-address +# V 3.0.2 +# - fixed: 74_Unifi: Minor bugfix in notify-function package main; @@ -190,9 +192,10 @@ sub Unifi_Undef($$) { sub Unifi_Notify($$) { my ($hash,$dev) = @_; my ($name,$self) = ($hash->{NAME},Unifi_Whoami()); + Log3 $name, 5, "$name ($self) - executed."; return if($dev->{NAME} ne "global"); - return if(!grep(m/^DEFINED|MODIFIED|INITIALIZED|REREADCFG$/, @{$dev->{CHANGED}})); + return if(!grep(m/^DEFINED $name|MODIFIED $name|INITIALIZED|REREADCFG$/, @{$dev->{CHANGED}})); if(AttrVal($name, "disable", 0)) { Log3 $name, 5, "$name ($self) - executed. - Device '$name' is disabled, do nothing..."; @@ -1315,7 +1318,7 @@ sub Unifi_SetWlanReadings($) { for my $wlanID (keys %{$hash->{wlans}}) { $wlanRef = $hash->{wlans}->{$wlanID}; $wlanName = makeReadingName($wlanRef->{name}); - readingsBulkUpdate($hash,'-WLAN_'.$wlanName.'_state',($wlanRef->{enabled} == JSON::true) ? 'enabled' : 'disabled'); + readingsBulkUpdate($hash,'-WLAN_'.$wlanName.'_state',($wlanRef->{enabled} eq JSON::true) ? 'enabled' : 'disabled'); } return undef; diff --git a/fhem/FHEM/74_UnifiSwitch.pm b/fhem/FHEM/74_UnifiSwitch.pm index 7ecdb80a2..b79b6fca5 100755 --- a/fhem/FHEM/74_UnifiSwitch.pm +++ b/fhem/FHEM/74_UnifiSwitch.pm @@ -14,6 +14,8 @@ # V 0.90 # - feature: 74_UnififSwitch: setter for poe-Mode # added commandref +# V 0.91 +# - fixed: 74_UnififSwitch: fixed wording in commandref # # TODOs: # - state des USW korrekt setzen (aktuell nur connected und provisioning) @@ -36,7 +38,7 @@ sub UnifiSwitch_Parse($$); sub UnifiSwitch_Whoami(); sub UnifiSwitch_Whowasi(); -my $version="0.90"; +my $version="0.91"; sub UnifiSwitch_Initialize($$) { my ($hash) = @_; @@ -201,7 +203,9 @@ sub UnifiSwitch_Parse($$) { if( $apRef->{type} eq 'usw' ){ if ($apRef->{state} eq "1"){ $hash->{STATE} = "connected"; - }elsif($apRef->{state} eq "5"){ + }elsif($apRef->{state} eq "4"){ + $hash->{STATE} = "upgrading"; + elsif($apRef->{state} eq "5"){ $hash->{STATE} = "provisioning"; }else{ $hash->{STATE} = "unknown: ".$apRef->{state}; # TODO: Weitere states setzen wenn state-id bekannt @@ -297,7 +301,7 @@ You can use the readings or set features to control your unifi-switch.
set <name> clear <readings|all>
set <name> poeMode <name|mac|id> <port> <off|auto|passive|passthrough|restart>
set <name> poeMode <port> <off|auto|passive|passthrough|restart>