mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-01 21:14:32 +02:00
added bridge_host data point
This commit is contained in:
parent
672b114dbd
commit
9b0dffa456
1 changed files with 25 additions and 0 deletions
|
@ -55,6 +55,7 @@ class MikrotikControllerData:
|
||||||
"routerboard": {},
|
"routerboard": {},
|
||||||
"resource": {},
|
"resource": {},
|
||||||
"interface": {},
|
"interface": {},
|
||||||
|
"bridge_host": {},
|
||||||
"arp": {},
|
"arp": {},
|
||||||
"arp_tmp": {},
|
"arp_tmp": {},
|
||||||
"nat": {},
|
"nat": {},
|
||||||
|
@ -278,6 +279,7 @@ class MikrotikControllerData:
|
||||||
await self.hass.async_add_executor_job(self.get_wireless_hosts)
|
await self.hass.async_add_executor_job(self.get_wireless_hosts)
|
||||||
|
|
||||||
await self.hass.async_add_executor_job(self.get_interface)
|
await self.hass.async_add_executor_job(self.get_interface)
|
||||||
|
await self.hass.async_add_executor_job(self.get_bridge_host)
|
||||||
await self.hass.async_add_executor_job(self.get_arp)
|
await self.hass.async_add_executor_job(self.get_arp)
|
||||||
await self.hass.async_add_executor_job(self.get_dns)
|
await self.hass.async_add_executor_job(self.get_dns)
|
||||||
await self.hass.async_add_executor_job(self.get_dhcp)
|
await self.hass.async_add_executor_job(self.get_dhcp)
|
||||||
|
@ -365,6 +367,29 @@ class MikrotikControllerData:
|
||||||
self.data["interface"][uid]["tx-bits-per-second"] * uom_div
|
self.data["interface"][uid]["tx-bits-per-second"] * uom_div
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# ---------------------------
|
||||||
|
# get_bridge_host
|
||||||
|
# ---------------------------
|
||||||
|
def get_bridge_host(self):
|
||||||
|
"""Get system resources data from Mikrotik"""
|
||||||
|
self.data["bridge_host"] = parse_api(
|
||||||
|
data=self.data["bridge_host"],
|
||||||
|
source=self.api.path("/interface/bridge/host"),
|
||||||
|
key="mac-address",
|
||||||
|
vals=[
|
||||||
|
{"name": "mac-address"},
|
||||||
|
{"name": "interface", "default": "unknown"},
|
||||||
|
{"name": "bridge", "default": "unknown"},
|
||||||
|
{
|
||||||
|
"name": "enabled",
|
||||||
|
"source": "disabled",
|
||||||
|
"type": "bool",
|
||||||
|
"reverse": True,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
only=[{"key": "local", "value": False}],
|
||||||
|
)
|
||||||
|
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
# get_interface_client
|
# get_interface_client
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue