Support input_datetime controls#4058
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #4048 by adding explicit support for Home Assistant input_datetime helpers when Predbat writes charge/discharge window times for “OTHER” inverter setups, preventing a WebSocket reconnect/crash loop caused by calling a non-existent HA service.
Changes:
- Updated inverter option-writing logic to treat
input_datetime.*entities as service-driven controls and callinput_datetime/set_datetime(instead ofset_value). - Extended the test HA service stub to handle
input_datetime/set_datetime. - Added regression tests to verify charge and discharge window writes work when configured with
input_datetimeentities.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/predbat/inverter.py | Ensures write_and_poll_option() uses input_datetime/set_datetime for input_datetime.* entities to avoid HA service_not_found errors. |
| apps/predbat/tests/test_infra.py | Adds a test stub handler for input_datetime/set_datetime so unit tests can validate state updates. |
| apps/predbat/tests/test_inverter.py | Adds regression coverage for writing charge/discharge windows via input_datetime entities (issue #4048). |
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.
#4048