mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-06-23 17:28:51 +02:00
added device tracking options to controller #24
This commit is contained in:
parent
1bd7cadaa4
commit
4f95ad8cc1
1 changed files with 23 additions and 0 deletions
|
@ -25,6 +25,10 @@ from .const import (
|
|||
DOMAIN,
|
||||
CONF_TRACK_IFACE_CLIENTS,
|
||||
DEFAULT_TRACK_IFACE_CLIENTS,
|
||||
CONF_TRACK_HOSTS,
|
||||
DEFAULT_TRACK_HOSTS,
|
||||
CONF_TRACK_HOSTS_TIMEOUT,
|
||||
DEFAULT_TRACK_HOST_TIMEOUT,
|
||||
CONF_SCAN_INTERVAL,
|
||||
DEFAULT_SCAN_INTERVAL,
|
||||
DEFAULT_UNIT_OF_MEASUREMENT,
|
||||
|
@ -138,6 +142,14 @@ class MikrotikControllerData:
|
|||
"""Config entry option to not track ARP."""
|
||||
return self.config_entry.options.get(CONF_TRACK_IFACE_CLIENTS, DEFAULT_TRACK_IFACE_CLIENTS)
|
||||
|
||||
# ---------------------------
|
||||
# option_track_network_hosts
|
||||
# ---------------------------
|
||||
@property
|
||||
def option_track_network_hosts(self):
|
||||
"""Config entry option to not track ARP."""
|
||||
return self.config_entry.options.get(CONF_TRACK_HOSTS, DEFAULT_TRACK_HOSTS)
|
||||
|
||||
# ---------------------------
|
||||
# option_scan_interval
|
||||
# ---------------------------
|
||||
|
@ -149,6 +161,17 @@ class MikrotikControllerData:
|
|||
)
|
||||
return timedelta(seconds=scan_interval)
|
||||
|
||||
# ---------------------------
|
||||
# option_track_network_hosts_timeout
|
||||
# ---------------------------
|
||||
@property
|
||||
def option_track_network_hosts_timeout(self):
|
||||
"""Config entry option scan interval."""
|
||||
track_network_hosts_timeout = self.config_entry.options.get(
|
||||
CONF_TRACK_HOSTS_TIMEOUT, DEFAULT_TRACK_HOST_TIMEOUT
|
||||
)
|
||||
return timedelta(seconds=track_network_hosts_timeout)
|
||||
|
||||
# ---------------------------
|
||||
# option_unit_of_measurement
|
||||
# ---------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue