Go to file
Dustin a2acdfd0dc mqtt: Manually handle reconnects
The Paho automatic reconnect capability is pretty useless.  While it
does automatically connect to the broker again after an unexpected
disconnect, it does not subscribe to the topics again.  Further, since
the broker will send the will message when the client disconnects
unexpectedly, we need to send our "online" availability message when we
reconnect.

To resolve both of these problems, the `MqttClient::run` method now
takes care reconnecting manually.  When it receives a disconnect
notification, it explicitly calls `AsyncClient::reconnect`.  Once that
succeeds, it resubscribes to the command topics and publishes an
"online" message.
2023-01-08 12:54:32 -06:00
src mqtt: Manually handle reconnects 2023-01-08 12:54:32 -06:00
.gitattributes Initial commit 2022-12-30 09:10:05 -06:00
.gitignore Add basic MQTT client functionality 2022-12-30 13:49:01 -06:00
Cargo.lock Add Home Assistant integration 2023-01-07 17:21:17 -06:00
Cargo.toml Add Home Assistant integration 2023-01-07 17:21:17 -06:00
rustfmt.toml Initial commit 2022-12-30 09:10:05 -06:00