Fix Mikrotik rename from wifiwave2 to wifi for upcoming RouterOS 7.13 (#104966)
Co-authored-by: Marco98 <Marco98@users.noreply.github.com>
This commit is contained in:
parent
482e087a85
commit
b7bc49b863
2 changed files with 11 additions and 0 deletions
|
@ -31,10 +31,12 @@ from .const import (
|
|||
IDENTITY,
|
||||
INFO,
|
||||
IS_CAPSMAN,
|
||||
IS_WIFI,
|
||||
IS_WIFIWAVE2,
|
||||
IS_WIRELESS,
|
||||
MIKROTIK_SERVICES,
|
||||
NAME,
|
||||
WIFI,
|
||||
WIFIWAVE2,
|
||||
WIRELESS,
|
||||
)
|
||||
|
@ -60,6 +62,7 @@ class MikrotikData:
|
|||
self.support_capsman: bool = False
|
||||
self.support_wireless: bool = False
|
||||
self.support_wifiwave2: bool = False
|
||||
self.support_wifi: bool = False
|
||||
self.hostname: str = ""
|
||||
self.model: str = ""
|
||||
self.firmware: str = ""
|
||||
|
@ -101,6 +104,7 @@ class MikrotikData:
|
|||
self.support_capsman = bool(self.command(MIKROTIK_SERVICES[IS_CAPSMAN]))
|
||||
self.support_wireless = bool(self.command(MIKROTIK_SERVICES[IS_WIRELESS]))
|
||||
self.support_wifiwave2 = bool(self.command(MIKROTIK_SERVICES[IS_WIFIWAVE2]))
|
||||
self.support_wifi = bool(self.command(MIKROTIK_SERVICES[IS_WIFI]))
|
||||
|
||||
def get_list_from_interface(self, interface: str) -> dict[str, dict[str, Any]]:
|
||||
"""Get devices from interface."""
|
||||
|
@ -128,6 +132,9 @@ class MikrotikData:
|
|||
elif self.support_wifiwave2:
|
||||
_LOGGER.debug("Hub supports wifiwave2 Interface")
|
||||
device_list = wireless_devices = self.get_list_from_interface(WIFIWAVE2)
|
||||
elif self.support_wifi:
|
||||
_LOGGER.debug("Hub supports wifi Interface")
|
||||
device_list = wireless_devices = self.get_list_from_interface(WIFI)
|
||||
|
||||
if not device_list or self.force_dhcp:
|
||||
device_list = self.all_devices
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue