mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-06-29 04:00:07 +02:00
added data["dns"] data point
This commit is contained in:
parent
f0fc6f3c25
commit
9c6712b511
1 changed files with 18 additions and 0 deletions
|
@ -58,6 +58,7 @@ class MikrotikControllerData:
|
||||||
"fw-update": {},
|
"fw-update": {},
|
||||||
"script": {},
|
"script": {},
|
||||||
"queue": {},
|
"queue": {},
|
||||||
|
"dns": {},
|
||||||
"dhcp-server": {},
|
"dhcp-server": {},
|
||||||
"dhcp": {},
|
"dhcp": {},
|
||||||
"host": {},
|
"host": {},
|
||||||
|
@ -196,11 +197,13 @@ class MikrotikControllerData:
|
||||||
await self.hass.async_add_executor_job(self.get_system_resource)
|
await self.hass.async_add_executor_job(self.get_system_resource)
|
||||||
await self.hass.async_add_executor_job(self.get_script)
|
await self.hass.async_add_executor_job(self.get_script)
|
||||||
await self.hass.async_add_executor_job(self.get_queue)
|
await self.hass.async_add_executor_job(self.get_queue)
|
||||||
|
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)
|
||||||
|
|
||||||
await self.hass.async_add_executor_job(self.process_host)
|
await self.hass.async_add_executor_job(self.process_host)
|
||||||
|
|
||||||
async_dispatcher_send(self.hass, self.signal_update)
|
async_dispatcher_send(self.hass, self.signal_update)
|
||||||
|
|
||||||
self.lock.release()
|
self.lock.release()
|
||||||
|
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
|
@ -662,6 +665,21 @@ class MikrotikControllerData:
|
||||||
self.data["queue"][uid]["upload-burst-time"] = upload_burst_time
|
self.data["queue"][uid]["upload-burst-time"] = upload_burst_time
|
||||||
self.data["queue"][uid]["download-burst-time"] = download_burst_time
|
self.data["queue"][uid]["download-burst-time"] = download_burst_time
|
||||||
|
|
||||||
|
# ---------------------------
|
||||||
|
# get_dns
|
||||||
|
# ---------------------------
|
||||||
|
def get_dns(self):
|
||||||
|
"""Get static DNS data from Mikrotik"""
|
||||||
|
self.data["dns"] = parse_api(
|
||||||
|
data=self.data["dns"],
|
||||||
|
source=self.api.path("/ip/dns/static"),
|
||||||
|
key="name",
|
||||||
|
vals=[
|
||||||
|
{"name": "name"},
|
||||||
|
{"name": "address"},
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
# get_dhcp
|
# get_dhcp
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue