mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-16 12:24:30 +02:00
Fixes from code review
This commit is contained in:
parent
1bbedfaa8b
commit
e828e0bf0a
1 changed files with 1 additions and 15 deletions
|
@ -284,13 +284,11 @@ class MikrotikCoordinator(DataUpdateCoordinator[None]):
|
|||
self.host_tracking_initialized = False
|
||||
|
||||
self.support_capsman = False
|
||||
self.support_wifi = False
|
||||
self.support_wireless = False
|
||||
self.support_wifiwave2 = False
|
||||
self.support_ppp = False
|
||||
self.support_ups = False
|
||||
self.support_gps = False
|
||||
self._wifimodule = None
|
||||
self._wifimodule = "wireless"
|
||||
|
||||
self.major_fw_version = 0
|
||||
self.minor_fw_version = 0
|
||||
|
@ -519,32 +517,22 @@ class MikrotikCoordinator(DataUpdateCoordinator[None]):
|
|||
self.support_ppp = True
|
||||
self.support_wireless = True
|
||||
if "wifiwave2" in packages and packages["wifiwave2"]["enabled"]:
|
||||
self.support_wifiwave2 = True
|
||||
self.support_wifi = False
|
||||
self.support_capsman = False
|
||||
self._wifimodule = "wifiwave2"
|
||||
|
||||
elif "wifi" in packages and packages["wifi"]["enabled"]:
|
||||
self.support_wifiwave2 = False
|
||||
self.support_wifi = True
|
||||
self.support_capsman = False
|
||||
self._wifimodule = "wifi"
|
||||
|
||||
elif "wifi-qcom" in packages and packages["wifi-qcom"]["enabled"]:
|
||||
self.support_wifiwave2 = False
|
||||
self.support_wifi = True
|
||||
self.support_capsman = False
|
||||
self._wifimodule = "wifi"
|
||||
|
||||
elif "wifi-qcom-ac" in packages and packages["wifi-qcom-ac"]["enabled"]:
|
||||
self.support_wifiwave2 = False
|
||||
self.support_wifi = True
|
||||
self.support_capsman = False
|
||||
self._wifimodule = "wifi"
|
||||
|
||||
else:
|
||||
self.support_wifiwave2 = False
|
||||
self.support_wifi = False
|
||||
self.support_capsman = True
|
||||
|
||||
_LOGGER.debug("Mikrotik %s wifi module=%s",
|
||||
|
@ -1994,11 +1982,9 @@ class MikrotikCoordinator(DataUpdateCoordinator[None]):
|
|||
|
||||
if self.major_fw_version >= 7 and self.minor_fw_version > 12:
|
||||
registration_path = "/interface/wifi/registration-table"
|
||||
self._wifimodule = "wifi"
|
||||
|
||||
else:
|
||||
registration_path= "/caps-man/registration-table"
|
||||
self._wifimodule = "wireless"
|
||||
|
||||
self.ds["capsman_hosts"] = parse_api(
|
||||
data={},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue