mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-22 19:54:23 +02:00
black
This commit is contained in:
parent
593aca593b
commit
80bae0c34d
4 changed files with 12 additions and 9 deletions
|
@ -118,6 +118,7 @@ DEVICE_ATTRIBUTES_NETWATCH = [
|
|||
"comment",
|
||||
]
|
||||
|
||||
|
||||
@dataclass
|
||||
class MikrotikBinarySensorEntityDescription(BinarySensorEntityDescription):
|
||||
"""Class describing mikrotik entities."""
|
||||
|
|
|
@ -285,7 +285,8 @@ class MikrotikControllerOptionsFlowHandler(OptionsFlow):
|
|||
vol.Optional(
|
||||
CONF_SENSOR_NETWATCH_TRACKER,
|
||||
default=self.config_entry.options.get(
|
||||
CONF_SENSOR_NETWATCH_TRACKER, DEFAULT_SENSOR_NETWATCH_TRACKER
|
||||
CONF_SENSOR_NETWATCH_TRACKER,
|
||||
DEFAULT_SENSOR_NETWATCH_TRACKER,
|
||||
),
|
||||
): bool,
|
||||
vol.Optional(
|
||||
|
|
|
@ -59,7 +59,9 @@ from .const import (
|
|||
CONF_SENSOR_SCRIPTS,
|
||||
DEFAULT_SENSOR_SCRIPTS,
|
||||
CONF_SENSOR_ENVIRONMENT,
|
||||
DEFAULT_SENSOR_ENVIRONMENT, CONF_SENSOR_NETWATCH_TRACKER, DEFAULT_SENSOR_NETWATCH_TRACKER,
|
||||
DEFAULT_SENSOR_ENVIRONMENT,
|
||||
CONF_SENSOR_NETWATCH_TRACKER,
|
||||
DEFAULT_SENSOR_NETWATCH_TRACKER,
|
||||
)
|
||||
from .exceptions import ApiEntryNotFound
|
||||
from .apiparser import parse_api
|
||||
|
@ -258,7 +260,7 @@ class MikrotikCoordinator(DataUpdateCoordinator[None]):
|
|||
"environment": {},
|
||||
"ups": {},
|
||||
"gps": {},
|
||||
"netwatch": {}
|
||||
"netwatch": {},
|
||||
}
|
||||
|
||||
self.notified_flags = []
|
||||
|
@ -393,7 +395,9 @@ class MikrotikCoordinator(DataUpdateCoordinator[None]):
|
|||
@property
|
||||
def option_sensor_netwatch(self):
|
||||
"""Config entry option to not track ARP."""
|
||||
return self.config_entry.options.get(CONF_SENSOR_NETWATCH_TRACKER, DEFAULT_SENSOR_NETWATCH_TRACKER)
|
||||
return self.config_entry.options.get(
|
||||
CONF_SENSOR_NETWATCH_TRACKER, DEFAULT_SENSOR_NETWATCH_TRACKER
|
||||
)
|
||||
|
||||
# ---------------------------
|
||||
# option_sensor_ppp
|
||||
|
|
|
@ -72,11 +72,8 @@ def _skip_sensor(config_entry, entity_description, data, uid) -> bool:
|
|||
):
|
||||
return True
|
||||
|
||||
if (
|
||||
entity_description.data_path == "netwatch"
|
||||
and not config_entry.options.get(
|
||||
if entity_description.data_path == "netwatch" and not config_entry.options.get(
|
||||
CONF_SENSOR_NETWATCH_TRACKER, DEFAULT_SENSOR_NETWATCH_TRACKER
|
||||
)
|
||||
):
|
||||
return True
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue