Do not save heartbeat to XML if it has not changed

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
Miika Turkia 2017-09-10 08:43:54 +03:00 committed by Dirk Hohndel
parent 643085f992
commit 15ef53fb80

View file

@ -282,7 +282,10 @@ static void save_sample(struct membuffer *b, struct sample *sample, struct sampl
put_milli(b, " po2='", sample->setpoint.mbar, " bar'");
old->setpoint = sample->setpoint;
}
show_index(b, sample->heartbeat, "heartbeat='", "'");
if (sample->heartbeat != old->heartbeat) {
show_index(b, sample->heartbeat, "heartbeat='", "'");
old->heartbeat = sample->heartbeat;
}
if (sample->bearing.degrees != old->bearing.degrees) {
show_index(b, sample->bearing.degrees, "bearing='", "'");
old->bearing.degrees = sample->bearing.degrees;