mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-08-01 00:14:29 +02:00
flush wireless registration table on each query #24
This commit is contained in:
parent
cd41d0c50f
commit
028de35d03
1 changed files with 5 additions and 5 deletions
|
@ -831,7 +831,7 @@ class MikrotikControllerData:
|
||||||
def get_capsman_hosts(self):
|
def get_capsman_hosts(self):
|
||||||
"""Get CAPS-MAN hosts data from Mikrotik"""
|
"""Get CAPS-MAN hosts data from Mikrotik"""
|
||||||
self.data["capsman_hosts"] = parse_api(
|
self.data["capsman_hosts"] = parse_api(
|
||||||
data=self.data["capsman_hosts"],
|
data={},
|
||||||
source=self.api.path("/caps-man/registration-table"),
|
source=self.api.path("/caps-man/registration-table"),
|
||||||
key="mac-address",
|
key="mac-address",
|
||||||
vals=[
|
vals=[
|
||||||
|
@ -847,14 +847,14 @@ class MikrotikControllerData:
|
||||||
def get_wireless_hosts(self):
|
def get_wireless_hosts(self):
|
||||||
"""Get wireless hosts data from Mikrotik"""
|
"""Get wireless hosts data from Mikrotik"""
|
||||||
self.data["wireless_hosts"] = parse_api(
|
self.data["wireless_hosts"] = parse_api(
|
||||||
data=self.data["wireless_hosts"],
|
data={},
|
||||||
source=self.api.path("/interface/wireless/registration-table"),
|
source=self.api.path("/interface/wireless/registration-table"),
|
||||||
key="mac-address",
|
key="mac-address",
|
||||||
vals=[
|
vals=[
|
||||||
{"name": "mac-address"},
|
{"name": "mac-address"},
|
||||||
{"name": "address", "default": "unknown"},
|
|
||||||
{"name": "interface", "default": "unknown"},
|
{"name": "interface", "default": "unknown"},
|
||||||
{"name": "ap", "type": "bool"},
|
{"name": "ap", "type": "bool"},
|
||||||
|
{"name": "uptime"},
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -908,8 +908,8 @@ class MikrotikControllerData:
|
||||||
|
|
||||||
self.data["host"][uid]["source"] = "wireless"
|
self.data["host"][uid]["source"] = "wireless"
|
||||||
for key, key_data in zip(
|
for key, key_data in zip(
|
||||||
["mac-address", "address", "interface"],
|
["mac-address", "interface"],
|
||||||
["mac-address", "address", "interface"],
|
["mac-address", "interface"],
|
||||||
):
|
):
|
||||||
if key not in self.data["host"][uid] or self.data["host"][uid][key] == "unknown":
|
if key not in self.data["host"][uid] or self.data["host"][uid][key] == "unknown":
|
||||||
self.data["host"][uid][key] = vals[key_data]
|
self.data["host"][uid][key] = vals[key_data]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue