feat: netwatch binary sensor

This commit is contained in:
Andrey Chalkin 2023-10-11 19:08:25 +02:00
parent 2cdd645274
commit 13e765c10a
No known key found for this signature in database
GPG key ID: 4564F1942FA13A00
9 changed files with 95 additions and 1 deletions

View file

@ -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