Skip to content

Re-send readonly state to hub#4106

Merged
springfall2008 merged 1 commit into
mainfrom
fix/gateway_readonly_resend
Jun 21, 2026
Merged

Re-send readonly state to hub#4106
springfall2008 merged 1 commit into
mainfrom
fix/gateway_readonly_resend

Conversation

@springfall2008

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 21, 2026 20:36

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 improves the GatewayMQTT “read-only” synchronization by periodically re-sending the set_read_only command so the ESP32 gateway can recover if it missed a non-retained MQTT message.

Changes:

  • Track the last time set_read_only was sent and re-publish the current state at least every 30 minutes.
  • Extend gateway tests to cover stale re-send behavior and the “just under interval” case.

Reviewed changes

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

File Description
apps/predbat/gateway.py Adds periodic re-send logic for set_read_only, including tracking last-send time.
apps/predbat/tests/test_gateway.py Adds unit tests validating the new periodic re-send behavior.

Comment thread apps/predbat/gateway.py
@springfall2008 springfall2008 merged commit b040555 into main Jun 21, 2026
2 checks passed
@springfall2008 springfall2008 deleted the fix/gateway_readonly_resend branch June 21, 2026 20:40
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