Skip to content

Commit 981d3b0

Browse files
billatqbillatq
andauthored
Decouple vehicle MQTT status from divert management (#315)
Co-authored-by: billatq <[email protected]>
1 parent 9044a01 commit 981d3b0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/mqtt.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,16 +214,19 @@ mqtt_connect()
214214
if (mqtt_grid_ie != "") {
215215
mqttclient.subscribe(mqtt_grid_ie);
216216
}
217-
if (mqtt_vehicle_soc != "") {
217+
}
218+
219+
// subscribe to vehicle information from MQTT if we are configured for it
220+
if (mqtt_vehicle_soc != "") {
218221
mqttclient.subscribe(mqtt_vehicle_soc);
219-
}
220-
if (mqtt_vehicle_range != "") {
222+
}
223+
if (mqtt_vehicle_range != "") {
221224
mqttclient.subscribe(mqtt_vehicle_range);
222-
}
223-
if (mqtt_vehicle_eta != "") {
225+
}
226+
if (mqtt_vehicle_eta != "") {
224227
mqttclient.subscribe(mqtt_vehicle_eta);
225-
}
226228
}
229+
227230
if (mqtt_vrms!="") {
228231
mqttclient.subscribe(mqtt_vrms);
229232
}

0 commit comments

Comments
 (0)