mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-15 16:19:11 +00:00
74_Unifi: Minor bugfix in notify-function
git-svn-id: https://svn.fhem.de/fhem/trunk@16900 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
bf62893e32
commit
01e0660903
@ -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;
|
||||
|
@ -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.
|
||||
<li><code>set <name> clear <readings|all></code><br>
|
||||
Clears the readings or all. </li>
|
||||
<br>
|
||||
<li><code>set <name> poeMode <name|mac|id> <port> <off|auto|passive|passthrough|restart></code><br>
|
||||
<li><code>set <name> poeMode <port> <off|auto|passive|passthrough|restart></code><br>
|
||||
Set PoE mode for <port>. </li>
|
||||
</ul>
|
||||
|
||||
@ -312,7 +316,7 @@ You can use the readings or set features to control your unifi-switch.
|
||||
<ul>The connection state of the port. Can be disconnected or in Mbps/Gbps.</ul>
|
||||
</li>
|
||||
<li>poe_current
|
||||
<ul>The current power-usage.</ul>
|
||||
<ul>The current of the port.</ul>
|
||||
</li>
|
||||
<li>poe_mode
|
||||
<ul>The poe-mode of the port.</ul>
|
||||
|
Loading…
x
Reference in New Issue
Block a user