Commit Graph
1 Commits
Author SHA1 Message Date
ea21fd6andGitHub 20610fbd97 Fix persistence threshold filter with UoM (#4881)
* Add tests with UoM conversion

For `PersistenceThresholdFilter` add a test case that fails when
using temperatures in °C and a threshold in Kelvin. The threshold
should ignore the offset (0 °C = 273,15 K).

Add another test with length to increase coverage.

Signed-off-by: Christoph Gehrke <cgdev@duck.com>

* Fix PersistenceThresholdFilter UoM conversion

Use `toUnitRelative()` instead of `toUnit()` for delta (the difference
of old and current state). In particular for temperatures an offset
of different units (like °C and K) should be ignored when considering
the delta.

Signed-off-by: Christoph Gehrke <cgdev@duck.com>

---------

Signed-off-by: Christoph Gehrke <cgdev@duck.com>
2025-07-13 12:28:54 +02:00