Auto: ablegacy-8 — per-tag deadband / change filter

Closes #251
This commit is contained in:
Joseph Doherty
2026-04-25 23:50:07 -04:00
parent 69069aa3be
commit eb5286148e
9 changed files with 443 additions and 8 deletions

View File

@@ -24,6 +24,16 @@ public sealed class SubscribeCommand : AbLegacyCommandBase
"Publishing interval in milliseconds (default 1000).")]
public int IntervalMs { get; init; } = 1000;
[CommandOption("deadband-absolute", Description =
"PR 8 — absolute change filter. Suppress notifications until |new - prev| >= this value. " +
"Booleans bypass; strings + status changes always publish.")]
public double? DeadbandAbsolute { get; init; }
[CommandOption("deadband-percent", Description =
"PR 8 — percent-of-previous change filter. Suppress notifications until " +
"|new - prev| >= |prev * pct / 100|. prev=0 always publishes.")]
public double? DeadbandPercent { get; init; }
public override async ValueTask ExecuteAsync(IConsole console)
{
ConfigureLogging();
@@ -35,7 +45,9 @@ public sealed class SubscribeCommand : AbLegacyCommandBase
DeviceHostAddress: Gateway,
Address: Address,
DataType: DataType,
Writable: false);
Writable: false,
AbsoluteDeadband: DeadbandAbsolute,
PercentDeadband: DeadbandPercent);
var options = BuildOptions([tag]);
await using var driver = new AbLegacyDriver(options, DriverInstanceId);