Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rjf/soc bug #254

Merged
merged 5 commits into from
Sep 5, 2024
Merged

Rjf/soc bug #254

merged 5 commits into from
Sep 5, 2024

Conversation

robfitzgerald
Copy link
Collaborator

@robfitzgerald robfitzgerald commented Sep 5, 2024

addresses the bug discovered in #241. it appears that:

  1. user-submitted value was correctly validated between 0 and 100
  2. bug: the percent value [0,100] was being used directly to scale incoming energy (multiplying it by 100)

so the energy state would always exceed 100%. how this ended up with a state model at 100% is unclear; could be because of vehicle_ops::as_soc_percent which clips the value between 0 and 100 again. but i'm not sure.

that said, it is working:

"battery_state": {
        "type": "soc",
        "unit": "percent",
        "format": {
            "floating_point": {
                "initial": 80.0
            }
        },
        "index": 0,
        "name": "battery_state"
    },

Closes #241.

Copy link
Collaborator

@nreinicke nreinicke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find, that was a subtle little bug. Thanks for fixing!

@robfitzgerald robfitzgerald merged commit 7ca47d1 into main Sep 5, 2024
5 checks passed
@robfitzgerald robfitzgerald deleted the rjf/soc-bug branch September 5, 2024 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query starting soc not propagating to state model
2 participants