Repository navigation
Derive override_current max from device current_max - #43
Closed
jeroentrappers wants to merge 1 commit into
Closed
jeroentrappers wants to merge 1 commit into
jeroentrappers wants to merge 1 commit into
Conversation
The override current number was hardcoded to native_max_value=16, so a SmartEVSE configured for a higher charge current (e.g. 32 A) could not be driven above 16 A from Home Assistant — no device setting, reload, restart or re-pair could lift it. Make native_max_value for smartevse_override_current follow the device's reported settings.current_max (already polled every cycle), falling back to the static description value when unavailable.
Owner
|
Code looks good, but I cannot test this currently; if we approve this PR it will be presented to all HACS users of this (deprecated!) integration. Can I trust you tested this thoroughly, looking at the HA logs for errors and warnings? |
Author
|
I had tested it, but in the meantime i've moved to using mqtt instead. |
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.
Problem
number.smartevse_*_override_currentis hardcoded tonative_max_value=16inconst.py. On a SmartEVSE configured for a higher charge current (e.g. 32 A via the CIRCUIT setting), the override current cannot be set above 16 A from Home Assistant — and nothing on the device side, an integration reload, a HA restart, or removing/re-adding the integration changes it, because the cap lives in the static entity description.Fix
Make
native_max_valuefor thesmartevse_override_currentnumber follow the device's own reportedsettings.current_max, which is already polled every cycle in_async_update_data(self._data["smartevse_current_max"]). Falls back to the static description value when the device max is unavailable. Other number entities are unaffected.Result
A 32 A-configured controller can now be driven up to 32 A from HA; a 16 A unit still maxes at 16 A. No user configuration required — the bound tracks the device.