const char *value_name;
const char *topic;
uint timeout;
+ bool is_string;
};
static const struct attr attr_table[] = {
.topic = "burrow/heating/water/active",
.timeout = 660,
},
+ {
+ .metric = "heating_error",
+ .value_name = "err",
+ .topic = "burrow/heating/error",
+ .timeout = 300,
+ },
+ {
+ .metric = "heating_clock",
+ .value_name = "t",
+ .topic = "burrow/heating/clock",
+ .timeout = 660,
+ .is_string = true,
+ },
};
/*** MQTT ***/
continue;
}
- bprintf(f, "%s %s=%s\n", a->metric, a->value_name, val);
+ if (!a->is_string)
+ bprintf(f, "%s %s=%s\n", a->metric, a->value_name, val);
+ else
+ bprintf(f, "%s %s=\"%s\"\n", a->metric, a->value_name, val);
}
influx_write_flush();
sleep(INFLUX_INTERVAL);