Add charging mode select to Silla Prism - #181424
Open
ebaschiera wants to merge 1 commit into
Open
Conversation
Wire the publish callback into the coordinator and expose the port operating mode (Solar/Normal/Pause) as a select entity.
8 tasks
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.
Breaking change
Proposed change
The initial Silla Prism PR (#176785) was reduced to a single platform for review, with the controls left as follow-ups. This is the first of them: the charging mode select.
The Prism publishes the port operating mode on a retained topic and accepts a
set_modecommand on the matching command topic, so the select reads its state from the accumulated status and writes back through the library's command builders. To make that possible, the coordinator now passes a publish callback toPrismDevice, mapping it ontomqtt.async_publish. That callback is the plumbing every remaining control platform will reuse.Only Solar, Normal and Pause are user-settable. The Prism also reports a fourth mode when its own load balancing suspends the session; it cannot be selected back, so
current_optionreturnsNoneand the entity reads as unknown while it lasts. The port state remains visible on the status sensor throughout.The shared test helper gained an optional platform list, since
snapshot_platformrequires a single loaded platform and the integration now sets up two.No library change is needed:
pysillaprism0.2.0 already exposes the command surface.Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: