Skip to content

Fix/gecloud reset readonly#3997

Merged
springfall2008 merged 2 commits into
mainfrom
fix/gecloud_reset_readonly
Jun 2, 2026
Merged

Fix/gecloud reset readonly#3997
springfall2008 merged 2 commits into
mainfrom
fix/gecloud_reset_readonly

Conversation

@springfall2008
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 2, 2026 20:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adds a “last started” timestamp surfaced via the web dashboard, and adjusts the GE Cloud Direct integration so the one-shot “enable default options” reset is skipped while Predbat is in read-only mode (with accompanying tests).

Changes:

  • Publish a new predbat.last_started timestamp sensor on startup and display it on the status dashboard.
  • Track whether GE Cloud “default options” have been applied, and gate the one-shot reset behind the read-only switch.
  • Add unit tests covering the read-only skip behavior and subsequent first non-read-only run behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
apps/predbat/web.py Displays the new last_started sensor in the Status table.
apps/predbat/tests/test_ge_cloud.py Adds run() mocks and tests ensuring defaults reset is skipped in read-only and runs after read-only is disabled.
apps/predbat/predbat.py Captures startup time and publishes it via a new output sensor; bumps version.
apps/predbat/output.py Adds publish_last_started() to publish the startup timestamp sensor.
apps/predbat/gecloud.py Adds default_options_done and skips default-reset when read-only is enabled.

Comment thread apps/predbat/gecloud.py
Comment on lines +1066 to 1069
if not self.default_options_done and self.get_state_wrapper(f"switch.{self.prefix}_set_read_only", default="off") != "on":
self.default_options_done = True
for device in self.device_list:
await self.enable_default_options(device, self.settings[device])
@springfall2008 springfall2008 merged commit 5070d68 into main Jun 2, 2026
2 checks passed
@springfall2008 springfall2008 deleted the fix/gecloud_reset_readonly branch June 2, 2026 20:10
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