Skip to content

Commit

Permalink
Always retain Home Assistant MQTT Discovery config topic (#777)
Browse files Browse the repository at this point in the history
* Fix issue where MQTT Discovery fails on broker reconnection

* Always retain the config topic/payload

* Fix tests
  • Loading branch information
bachya authored Nov 22, 2023
1 parent 2e04ac3 commit 863401d
Show file tree
Hide file tree
Showing 2 changed files with 444 additions and 442 deletions.
4 changes: 3 additions & 1 deletion ecowitt2mqtt/helpers/publisher/mqtt/hass.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,9 @@ async def async_publish(self, data: dict[str, CalculatedValueType]) -> None:
},
)
),
retain=self._config.mqtt_retain,
# We always retain the config payload:
# https://github.com/bachya/ecowitt2mqtt/issues/760#issuecomment-1821340217
retain=True,
)
)
)
Expand Down
Loading

0 comments on commit 863401d

Please sign in to comment.