UniFi - Roaming clients should be considered connected (#33942)

* Roaming clients should be considered connected

* Bump dependency
This commit is contained in:
Robert Svensson 2020-04-10 15:43:25 +02:00 committed by GitHub
parent 8e188d7e75
commit bc036351f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 8 deletions

View file

@ -3,7 +3,11 @@
"name": "Ubiquiti UniFi",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/unifi",
"requirements": ["aiounifi==16"],
"codeowners": ["@kane610"],
"requirements": [
"aiounifi==17"
],
"codeowners": [
"@kane610"
],
"quality_scale": "platinum"
}

View file

@ -11,6 +11,7 @@ from aiounifi.events import (
WIRELESS_CLIENT_BLOCKED,
WIRELESS_CLIENT_CONNECTED,
WIRELESS_CLIENT_DISCONNECTED,
WIRELESS_CLIENT_ROAM,
WIRELESS_CLIENT_UNBLOCKED,
)
@ -24,7 +25,11 @@ LOGGER = logging.getLogger(__name__)
CLIENT_BLOCKED = (WIRED_CLIENT_BLOCKED, WIRELESS_CLIENT_BLOCKED)
CLIENT_UNBLOCKED = (WIRED_CLIENT_UNBLOCKED, WIRELESS_CLIENT_UNBLOCKED)
WIRED_CLIENT = (WIRED_CLIENT_CONNECTED, WIRED_CLIENT_DISCONNECTED)
WIRELESS_CLIENT = (WIRELESS_CLIENT_CONNECTED, WIRELESS_CLIENT_DISCONNECTED)
WIRELESS_CLIENT = (
WIRELESS_CLIENT_CONNECTED,
WIRELESS_CLIENT_DISCONNECTED,
WIRELESS_CLIENT_ROAM,
)
class UniFiClient(Entity):
@ -66,8 +71,9 @@ class UniFiClient(Entity):
if self.client.last_updated == SOURCE_EVENT:
if self.client.event.event in WIRELESS_CLIENT:
self.wireless_connection = (
self.client.event.event == WIRELESS_CLIENT_CONNECTED
self.wireless_connection = self.client.event.event in (
WIRELESS_CLIENT_CONNECTED,
WIRELESS_CLIENT_ROAM,
)
elif self.client.event.event in WIRED_CLIENT:

View file

@ -211,7 +211,7 @@ aiopylgtv==0.3.3
aioswitcher==1.1.0
# homeassistant.components.unifi
aiounifi==16
aiounifi==17
# homeassistant.components.wwlln
aiowwlln==2.0.2

View file

@ -94,7 +94,7 @@ aiopylgtv==0.3.3
aioswitcher==1.1.0
# homeassistant.components.unifi
aiounifi==16
aiounifi==17
# homeassistant.components.wwlln
aiowwlln==2.0.2