2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-07 06:48:43 +00:00

74_Unifi.pm: Fixed unsupported character in readings.

git-svn-id: https://svn.fhem.de/fhem/trunk@10964 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rapster 2016-02-29 13:38:53 +00:00
parent 5a3682e7dd
commit 67f2109d00
2 changed files with 19 additions and 12 deletions

View File

@ -1,5 +1,7 @@
# 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: 74_Unifi.pm: Changed unsupported character for AP and UC readings
from hash to hyphen.
- feature 49_SSCAM: enhanced command runView by option "link_open" to
open a streamlink immediately
- feature: new module LGTV_IP12 for controlling LG SmartTV's manufactured

View File

@ -488,6 +488,7 @@ sub Unifi_GetClients_Send($) {
HttpUtils_NonblockingGet( {
%{$hash->{httpParams}},
method => "GET",
url => $hash->{unifi}->{url}."stat/sta",
callback => $hash->{updateDispatch}->{$self}[2]
} );
@ -530,6 +531,7 @@ sub Unifi_GetWlans_Send($) {
HttpUtils_NonblockingGet( {
%{$hash->{httpParams}},
method => "GET",
url => $hash->{unifi}->{url}."list/wlanconf",
callback => $hash->{updateDispatch}->{$self}[2],
} );
@ -572,6 +574,7 @@ sub Unifi_GetHealth_Send($) {
HttpUtils_NonblockingGet( {
%{$hash->{httpParams}},
method => "GET",
url => $hash->{unifi}->{url}."stat/health",
callback => $hash->{updateDispatch}->{$self}[2],
} );
@ -615,6 +618,7 @@ sub Unifi_GetWlanGroups_Send($) {
HttpUtils_NonblockingGet( {
%{$hash->{httpParams}},
method => "GET",
url => $hash->{unifi}->{url}."list/wlangroup",
callback => $hash->{updateDispatch}->{$self}[2],
} );
@ -834,12 +838,12 @@ sub Unifi_SetHealthReadings($) {
my ($name,$self) = ($hash->{NAME},Unifi_Whoami());
Log3 $name, 5, "$name ($self) - executed.";
readingsBulkUpdate($hash,'#UC_wlan_state',$hash->{wlan_health}->{status});
readingsBulkUpdate($hash,'#UC_wlan_users',$hash->{wlan_health}->{num_user});
readingsBulkUpdate($hash,'#UC_wlan_accesspoints',$hash->{wlan_health}->{num_ap});
readingsBulkUpdate($hash,'#UC_wlan_guests',$hash->{wlan_health}->{num_guest});
readingsBulkUpdate($hash,'#UC_unarchived_alerts',scalar @{$hash->{alerts_unarchived}}) if(defined $hash->{alerts_unarchived});
readingsBulkUpdate($hash,'#UC_events',scalar(@{$hash->{events}}).' (last '.$hash->{unifi}->{eventPeriod}.'h)') if(defined $hash->{events});
readingsBulkUpdate($hash,'-UC_wlan_state',$hash->{wlan_health}->{status});
readingsBulkUpdate($hash,'-UC_wlan_users',$hash->{wlan_health}->{num_user});
readingsBulkUpdate($hash,'-UC_wlan_accesspoints',$hash->{wlan_health}->{num_ap});
readingsBulkUpdate($hash,'-UC_wlan_guests',$hash->{wlan_health}->{num_guest});
readingsBulkUpdate($hash,'-UC_unarchived_alerts',scalar @{$hash->{alerts_unarchived}});
readingsBulkUpdate($hash,'-UC_events',scalar(@{$hash->{events}}).' (last '.$hash->{unifi}->{eventPeriod}.'h)');
return undef;
}
@ -864,12 +868,13 @@ sub Unifi_SetAccesspointReadings($) {
my $essid = 'none';
}
readingsBulkUpdate($hash,'#AP_'.$apName.'_state',($apRef->{state} == 1) ? 'ok' : 'error');
readingsBulkUpdate($hash,'#AP_'.$apName.'_clients',$apRef->{'num_sta'});
readingsBulkUpdate($hash,'#AP_'.$apName.'_essid',$essid);
# readingsBulkUpdate($hash,'#AP_'.$apName.'_guests',$apRef->{'guest-num_sta'});
# readingsBulkUpdate($hash,'#AP_'.$apName.'_users',$apRef->{'user-num_sta'});
# readingsBulkUpdate($hash,'#AP_'.$apName.'_last_seen',$apRef->{'last_seen'});
readingsBulkUpdate($hash,'-AP_'.$apName.'_state',($apRef->{state} == 1) ? 'ok' : 'error');
readingsBulkUpdate($hash,'-AP_'.$apName.'_clients',$apRef->{'num_sta'});
readingsBulkUpdate($hash,'-AP_'.$apName.'_essid',$essid);
readingsBulkUpdate($hash,'-AP_'.$apName.'_locate',(!defined $apRef->{locating}) ? 'unknown' : ($apRef->{locating}) ? 'on' : 'off');
# readingsBulkUpdate($hash,'-AP_'.$apName.'_guests',$apRef->{'guest-num_sta'});
# readingsBulkUpdate($hash,'-AP_'.$apName.'_users',$apRef->{'user-num_sta'});
# readingsBulkUpdate($hash,'-AP_'.$apName.'_last_seen',$apRef->{'last_seen'});
}
return undef;