fixed tracking of hosts connected directly to mikrotik port that is using bridge

This commit is contained in:
tomaae 2020-04-12 22:12:35 +02:00
parent 9b9d54c3c4
commit d1ac4c1e88

View file

@ -307,12 +307,16 @@ class MikrotikControllerData:
and self.data["host"][uid]["address"] != "unknown"
and self.data["host"][uid]["interface"] != "unknown"
):
tmp_interface = self.data["host"][uid]["interface"]
if uid in self.data["arp"] and self.data["arp"][uid]["bridge"] != "":
tmp_interface = self.data["arp"][uid]["bridge"]
self.data["host"][uid][
"available"
] = await self.hass.async_add_executor_job(
self.api_ping.arp_ping,
self.data["host"][uid]["address"],
self.data["host"][uid]["interface"],
tmp_interface,
)
# Update last seen