Added wireless host signal information, fixes #413

This commit is contained in:
Tomaae 2025-05-01 13:19:52 +02:00
parent 477c68cf55
commit 332b1a6657
No known key found for this signature in database
GPG key ID: 60C51A657EEF2D87
2 changed files with 16 additions and 1 deletions

View file

@ -2056,6 +2056,10 @@ class MikrotikCoordinator(DataUpdateCoordinator[None]):
{"name": "interface", "default": "unknown"},
{"name": "ap", "type": "bool"},
{"name": "uptime"},
{"name": "signal-strength"},
{"name": "tx-ccq"},
{"name": "tx-rate"},
{"name": "rx-rate"},
],
)
@ -2094,7 +2098,14 @@ class MikrotikCoordinator(DataUpdateCoordinator[None]):
wireless_detected[uid] = True
self.ds["host"][uid]["available"] = True
self.ds["host"][uid]["last-seen"] = utcnow()
for key in ["mac-address", "interface"]:
for key in [
"mac-address",
"interface",
"signal-strength",
"tx-ccq",
"tx-rate",
"rx-rate",
]:
self.ds["host"][uid][key] = vals[key]
# Add hosts from DHCP

View file

@ -16,6 +16,10 @@ DEVICE_ATTRIBUTES_HOST = [
"authorized",
"bypassed",
"last-seen",
"signal-strength",
"tx-ccq",
"tx-rate",
"rx-rate",
]