Pre-commit

This commit is contained in:
Cabooman 2024-02-01 22:29:30 +01:00
parent 620db2cc33
commit 12b83e7605
3 changed files with 4 additions and 9 deletions

View file

@ -28,12 +28,8 @@ static void publish_values(void) {
" \"cell_max_voltage\": %d,\n"
" \"cell_min_voltage\": %d\n"
"}\n",
((float)SOC) / 100.0,
((float)StateOfHealth) / 100.0,
((float)((int16_t)temperature_min)) / 10.0,
((float)((int16_t)temperature_max)) / 10.0,
cell_max_voltage,
cell_min_voltage);
((float)SOC) / 100.0, ((float)StateOfHealth) / 100.0, ((float)((int16_t)temperature_min)) / 10.0,
((float)((int16_t)temperature_max)) / 10.0, cell_max_voltage, cell_min_voltage);
bool result = client.publish("battery_testing/info", mqtt_msg, true);
Serial.println(mqtt_msg); // Uncomment to print the payload on serial
}
@ -98,6 +94,6 @@ void mqtt_loop(void) {
}
}
bool mqtt_publish_retain(const char *topic) {
bool mqtt_publish_retain(const char* topic) {
return client.publish(topic, mqtt_msg, true);
}