Skip to content

mqtt: publish API override state#340

Merged
MaStr merged 1 commit into
MaStr:mainfrom
filiplajszczak:mqtt-api-override-state
Apr 19, 2026
Merged

mqtt: publish API override state#340
MaStr merged 1 commit into
MaStr:mainfrom
filiplajszczak:mqtt-api-override-state

Conversation

@filiplajszczak
Copy link
Copy Markdown
Contributor

This publishes batcontrol’s temporary API-override state via MQTT and Home Assistant discovery so external/manual control becomes visible as a first-class runtime signal.

@MaStr MaStr requested a review from Copilot April 18, 2026 14:40
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

Publishes batcontrol’s temporary API-override state via MQTT (including Home Assistant discovery) so external/manual control is visible as a runtime signal.

Changes:

  • Add retained MQTT topic publishing for api_override_active.
  • Expose api_override_active as a Home Assistant MQTT discovery binary_sensor (diagnostic).
  • Add/extend tests to cover discovery and publish behavior around API overrides.

Reviewed changes

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

File Description
src/batcontrol/mqtt_api.py Adds publish_api_override_active() and HA discovery entry for the new binary sensor.
src/batcontrol/core.py Publishes MQTT override state when overrides are set/cleared and during static value refresh.
tests/batcontrol/test_mqtt_api.py Adds a discovery test asserting the new HA entity is published.
tests/batcontrol/test_core.py Adds tests ensuring API actions publish override-active and run() clears/publishes inactive.

Comment thread tests/batcontrol/test_mqtt_api.py
@filiplajszczak filiplajszczak requested a review from MaStr April 19, 2026 13:52
@MaStr MaStr merged commit 8cf9402 into MaStr:main Apr 19, 2026
14 checks passed
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.

3 participants