Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Tests: no invented numbers

- `drivers/tests/lua_harness/no_invented_numbers.lua` runs a driver twice with different registers, config and clock, then makes every read fail and every Modbus reply short. A number the driver still emits that is equal in both runs and was not read is invented: 0 W, 0 A, 0 % SoC, 50 Hz. A failed read must leave the value nil, so the host sends null. Sourceful's driver registry runs the same file on every publish.
- `drivers/tests/test_no_invented_numbers.py` ratchets against `invented-number-baseline.json`: 44 of 91 drivers carry this debt today. A count that rises fails, a driver not listed must be clean, and a count that falls fails until the file is updated. `make invented-number-report ID=<id>` prints the fields for one driver.

## tesla_vehicle 0.2.5

- Recover missing, partial and old SoC with a telemetry-only wake and read.
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ KIND ?= meter
LEVEL ?= patch

.PHONY: bootstrap new-driver test-driver check boundary \
refused-write-report absent-register-report \
refused-write-report absent-register-report invented-number-report \
sync-manifests bump-driver history ftw-baseline ftw-baseline-report \
host-api site watch-upstream-docs

Expand Down Expand Up @@ -40,6 +40,12 @@ refused-write-report:
test -n "$(ID)"
./lua55 drivers/tests/lua_harness/refused_write_probe.lua . "drivers/lua/$(ID).lua"

# Which fields a driver still fills with a number once its device stops
# answering. A failed read has to stay nil, so the host sends null, not 0.
invented-number-report:
test -n "$(ID)"
./lua55 drivers/tests/lua_harness/no_invented_numbers.lua drivers/tests/lua_harness "drivers/lua/$(ID).lua"

bootstrap:
uv sync --frozen --extra package --extra dev

Expand Down
59 changes: 59 additions & 0 deletions drivers/tests/invented-number-baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"_comment": [
"Fields a driver emits a number for after its device stopped answering,",
"a number that came from no read, config or clock (0 W, 50 Hz, 0 % SoC).",
"",
"This file records debt that already shipped: 44 of the 91 drivers when",
"drivers/tests/test_no_invented_numbers.py was added. The test ratchets:",
"a count that rises fails, a driver not listed must be clean, and a count",
"that falls fails until this file is updated. Shrink it. Never grow it.",
"",
"make invented-number-report ID=<id> prints the fields for one driver."
],
"drivers": {
"abb_meter": 13,
"abb_terra": 8,
"acrel": 13,
"acuvim": 8,
"alfen": 8,
"alphaess": 10,
"atmoce": 13,
"carlo_gavazzi": 13,
"chint": 13,
"circutor": 13,
"ctek": 9,
"ctek_hybrid": 9,
"ctek_v2": 9,
"deye": 28,
"easee": 4,
"etrel": 8,
"ferroamp_modbus": 18,
"fronius": 11,
"goe": 8,
"goodwe": 24,
"growatt": 20,
"hello": 3,
"janitza": 13,
"keba": 8,
"kostal": 22,
"kstar": 9,
"mennekes": 8,
"schneider_meter": 13,
"schrack_ev": 8,
"siemens_pac": 13,
"sigenergy": 5,
"sma": 28,
"sma_pv": 21,
"socomec": 13,
"sofar": 21,
"solaredge": 20,
"solax": 15,
"solinteg": 27,
"solis": 27,
"solis_string": 21,
"sungrow": 20,
"varta": 5,
"victron": 10,
"wallbox": 2
}
}
Loading
Loading