🚧 WIP
This commit is contained in:
@@ -276,9 +276,11 @@ def _validate(config: Config) -> None:
|
||||
)
|
||||
if config.opc.connect_timeout_s <= 0:
|
||||
raise ConfigError(f"opc.connect_timeout_s: must be > 0, got {config.opc.connect_timeout_s}")
|
||||
if not config.tags:
|
||||
if not config.tags and not config.devices:
|
||||
raise ConfigError(
|
||||
"tags: at least one tag is required — without tags there is nothing to monitor"
|
||||
"tags: nothing to monitor - define at least one tag or device "
|
||||
"indicator (devices: entries alone are fine, tags: entries alone "
|
||||
"are fine; both empty means the tool would read nothing)"
|
||||
)
|
||||
names = [t.name for t in config.tags]
|
||||
duplicates = sorted({n for n in names if names.count(n) > 1})
|
||||
|
||||
@@ -225,6 +225,8 @@ def _cmd_check_config(config_path: str) -> int:
|
||||
print(f" devices: {len(config.devices)} link indicator(s):")
|
||||
for device in config.devices:
|
||||
print(f" {device.name} <- {device.tag}")
|
||||
if not config.tags and config.devices:
|
||||
print(" note: no surveillance tags - monitoring device links only")
|
||||
print(f" poll: every {config.poll.interval_s} s, hang flagged after {config.poll.timeout_ms} ms")
|
||||
return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user