on publish error message
This commit is contained in:
parent
4296501979
commit
f5f0739313
@ -137,8 +137,9 @@ int main(int argc, char *argv[])
|
||||
sprintf(mqtt_topic, "homeassistant/sensor/cyblemeter_%s/state", meter_id);
|
||||
|
||||
printf("Liters: %i\n", meter_data.liters);
|
||||
mosquitto_publish(mosq, NULL, mqtt_topic, strlen(buff),buff,0,false);
|
||||
|
||||
|
||||
if(mosquitto_publish(mosq, NULL, mqtt_topic, strlen(buff),buff,0,false) != MOSQ_ERR_SUCCESS)
|
||||
fprintf(stderr, "ERROR: could not publish message")
|
||||
|
||||
mosquitto_destroy(mosq);
|
||||
mosquitto_lib_cleanup();
|
||||
|
Loading…
x
Reference in New Issue
Block a user