feat(nibe_local): convert diagnostic kW/kWh to W/Wh at emit - #99
Merged
Conversation
nibe_local 1.1.3 and myuplink 1.2.1 scale vendor kilowatts/kilowatt-hours to W/Wh at host.emit_metric. Headline names hp_energy_consumed_kwh and hp_energy_produced_kwh stay so existing series keys do not move; the unit field is Wh. Vendor unit strings are trimmed and case-folded. This is the first Lua edit of nibe_local off the FTW baseline, so the DRIVER table now declares read_only (otherwise the channel infers control from driver_command) and api_get wraps HTTP/JSON in pcall. Catalog HTTP tests accept https:// for a pinned local TLS device and uppercase poll-interval constants. A harness pins the conversion. Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nibe_local1.1.3 andmyuplink1.2.1 convert vendor kW/kWh to W/Wh athost.emit_metric. Vendor unit strings are trimmed and case-folded; unknown units keep their original string.hp_energy_consumed_kwh/hp_energy_produced_kwhstay so existing series keys do not move. The unit field is Wh.myuplinkhas no those headlines; energy there is a sanitized bulk name.nibe_localoff the FTW baseline:DRIVER.read_only = trueso the signed artifact is not published as controlling, andapi_getwraps HTTP/JSON inpcall.https://for a pinned local TLS device and uppercase poll-interval constants. A harness pins kW→W and kWh→Wh.Test plan
make test-driver ID=nibe_local(39 passed)make test-driver ID=myuplink(35 passed)pytest drivers/tests tests(3978 passed, 1356 skipped)origin/main(525583a)