Repository navigation
Conversation
bat_soc is nil after a failed SoC read, and the headroom calculation then raised a Lua error whenever battery_capacity_wh was set. Guard it the same way as the 50-125k-svk drivers. Version 0.2.2 -> 0.2.3. Reported and fixed in murre87/energywizard#215 by lazgeo. Co-authored-by: lazgeo <gl@glic.se> Signed-off-by: Emil Axfors <17743298+murre87@users.noreply.github.com>
murre87
added a commit
to murre87/energywizard
that referenced
this pull request
Nov 10, 2026
…rivers#224, #231) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
deye-svk.luacomputes the energy headroom frombat_socwheneverbattery_capacity_wh > 0. When the SoC read fails in a poll,bat_socis nil andmath.floor(bat_soc * 100 + 0.5)raises a Lua error, so the whole poll fails. This adds the same guard the 50-125k-svk drivers already use (and bat_soc), so the headroom stays 0 for that poll. Version 0.2.2 -> 0.2.3 in the driver and manifest, CHANGELOG entry under Unreleased.Seen in the field in EnergyWizard (driver from commit
e07d27038e83): automatic error reportftw_deye-svk.poll: LuaError, murre87/energywizard#215. Fixed there by lazgeo (Co-authored-by in the commit). Context: murre87/energywizard#231.Driver evidence
Safety
Control evidence
not applicable (no control path changes)
Checks
Signed-off-by.make test-driver ID=deye-svk(not run locally)make check(not run locally; the Lua compiles with Lua 5.4)