Skip to content

Commit

Permalink
Fix for bug in host network info collector
Browse files Browse the repository at this point in the history
Fixed bug in host network info collector (Issue home-assistant#2779)
  • Loading branch information
eparla774 committed Apr 18, 2021
1 parent 092d526 commit 7a1cb38
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions supervisor/host/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,17 @@ def _map_nm_wifi(inet: NetworkInterface) -> Optional[WifiConfig]:
auth = None
if not inet.settings.wireless_security:
auth = AuthMethod.OPEN
if inet.settings.wireless_security.key_mgmt == "none":
elif inet.settings.wireless_security.key_mgmt == "none":
auth = AuthMethod.WEP
elif inet.settings.wireless_security.key_mgmt == "wpa-psk":
auth = AuthMethod.WPA_PSK

# PSK
if not inet.settings.wireless_security:
psk = None
else:
psk = inet.settings.wireless_security.psk

# WifiMode
mode = WifiMode.INFRASTRUCTURE
if inet.settings.wireless.mode:
Expand All @@ -369,7 +375,7 @@ def _map_nm_wifi(inet: NetworkInterface) -> Optional[WifiConfig]:
mode,
inet.settings.wireless.ssid,
auth,
inet.settings.wireless_security.psk,
psk,
signal,
)

Expand Down

0 comments on commit 7a1cb38

Please sign in to comment.