mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-02 21:44:31 +02:00
feat: netwatch binary sensor
This commit is contained in:
parent
2cdd645274
commit
13e765c10a
9 changed files with 95 additions and 1 deletions
|
@ -26,6 +26,8 @@ from .const import (
|
|||
DEFAULT_TRACK_HOSTS,
|
||||
CONF_SENSOR_PORT_TRACKER,
|
||||
DEFAULT_SENSOR_PORT_TRACKER,
|
||||
CONF_SENSOR_NETWATCH_TRACKER,
|
||||
DEFAULT_SENSOR_NETWATCH_TRACKER,
|
||||
)
|
||||
from .coordinator import MikrotikCoordinator, MikrotikTrackerCoordinator
|
||||
from .helper import format_attribute
|
||||
|
@ -70,6 +72,14 @@ def _skip_sensor(config_entry, entity_description, data, uid) -> bool:
|
|||
):
|
||||
return True
|
||||
|
||||
if (
|
||||
entity_description.data_path == "netwatch"
|
||||
and not config_entry.options.get(
|
||||
CONF_SENSOR_NETWATCH_TRACKER, DEFAULT_SENSOR_NETWATCH_TRACKER
|
||||
)
|
||||
):
|
||||
return True
|
||||
|
||||
# Device Tracker
|
||||
if (
|
||||
# Skip if host tracking is disabled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue