Skip to content

Support input_datetime controls#4058

Merged
springfall2008 merged 1 commit into
mainfrom
fix/inverter_datetime
Jun 14, 2026
Merged

Support input_datetime controls#4058
springfall2008 merged 1 commit into
mainfrom
fix/inverter_datetime

Conversation

@springfall2008

Copy link
Copy Markdown
Owner

Copilot AI review requested due to automatic review settings June 14, 2026 07:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 call input_datetime/set_datetime (instead of set_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_datetime entities.

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).

@springfall2008 springfall2008 merged commit 6881544 into main Jun 14, 2026
2 checks passed
@springfall2008 springfall2008 deleted the fix/inverter_datetime branch June 14, 2026 07:56
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.

2 participants