From d1ac4c1e88660d3dbc697551f8822fb1d81ac3b2 Mon Sep 17 00:00:00 2001 From: tomaae <23486452+tomaae@users.noreply.github.com> Date: Sun, 12 Apr 2020 22:12:35 +0200 Subject: [PATCH] fixed tracking of hosts connected directly to mikrotik port that is using bridge --- custom_components/mikrotik_router/mikrotik_controller.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/custom_components/mikrotik_router/mikrotik_controller.py b/custom_components/mikrotik_router/mikrotik_controller.py index 4dbfdc5..aa11205 100644 --- a/custom_components/mikrotik_router/mikrotik_controller.py +++ b/custom_components/mikrotik_router/mikrotik_controller.py @@ -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