This commit is contained in:
Jonas Bengtsson
2026-10-08 08:12:04 +02:00
parent 1478db73a9
commit ca0bb0d048
5 changed files with 40 additions and 5 deletions
+4 -2
View File
@@ -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})
+2
View File
@@ -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