From 63d8dea9e47f08427048614208f80ecd88c68be3 Mon Sep 17 00:00:00 2001 From: Helge Weissig Date: Tue, 2 Apr 2019 16:34:24 -0700 Subject: [PATCH 1/2] fixed handling of _inch suffix when converting to SI --- src/rtl_433.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rtl_433.c b/src/rtl_433.c index 190077936..bf907ba0a 100644 --- a/src/rtl_433.c +++ b/src/rtl_433.c @@ -585,9 +585,10 @@ void data_acquired_handler(r_device *r_dev, data_t *data) d->format = new_format_label; } // Convert double type fields ending in _in to _mm - else if ((d->type == DATA_DOUBLE) && str_endswith(d->key, "_in")) { + else if ((d->type == DATA_DOUBLE) && + (str_endswith(d->key, "_in") || str_endswith(d->key, "_inch"))) { *(double*)d->value = inch2mm(*(double*)d->value); - char *new_label = str_replace(d->key, "_in", "_mm"); + char *new_label = str_replace(str_replace(d->key, "_inch", "_in"), "_in", "_mm"); free(d->key); d->key = new_label; char *new_format_label = str_replace(d->format, "in", "mm"); From fe20d09c27c0666960c1c22e92077cd58c250fc9 Mon Sep 17 00:00:00 2001 From: Helge Weissig Date: Tue, 2 Apr 2019 16:34:57 -0700 Subject: [PATCH 2/2] changed "Ok" to "OK" to streamline battery reporting --- src/devices/ambient_weather.c | 2 +- src/devices/vaillant_vrt340f.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devices/ambient_weather.c b/src/devices/ambient_weather.c index f035b159f..83988751d 100644 --- a/src/devices/ambient_weather.c +++ b/src/devices/ambient_weather.c @@ -49,7 +49,7 @@ ambient_weather_decode(r_device *decoder, bitbuffer_t *bitbuffer, unsigned row, "model", "", DATA_STRING, _X("Ambientweather-F007TH","Ambient Weather F007TH Thermo-Hygrometer"), _X("id","device"), "House Code", DATA_INT, deviceID, "channel", "Channel", DATA_INT, channel, - "battery", "Battery", DATA_STRING, isBatteryLow ? "Low" : "Ok", + "battery", "Battery", DATA_STRING, isBatteryLow ? "Low" : "OK", "temperature_F", "Temperature", DATA_FORMAT, "%.1f F", DATA_DOUBLE, temperature, "humidity", "Humidity", DATA_FORMAT, "%u %%", DATA_INT, humidity, "mic", "Integrity", DATA_STRING, "CRC", diff --git a/src/devices/vaillant_vrt340f.c b/src/devices/vaillant_vrt340f.c index ec91be95b..c5146d489 100644 --- a/src/devices/vaillant_vrt340f.c +++ b/src/devices/vaillant_vrt340f.c @@ -157,7 +157,7 @@ vaillant_vrt340_callback(r_device *decoder, bitbuffer_t *bitbuffer) "heating", "Heating Mode", DATA_STRING, (heating_mode==0)?"OFF":((heating_mode==1)?"ON (2-point)":"ON (analogue)"), "heating_temp", "Heating Water Temp.", DATA_FORMAT, "%d", DATA_INT, (int16_t)target_temperature, "water", "Pre-heated Water", DATA_STRING, water_preheated ? "ON" : "off", - "battery", "Battery", DATA_STRING, isBatteryLow ? "Low" : "Ok", + "battery", "Battery", DATA_STRING, isBatteryLow ? "Low" : "OK", NULL); decoder_output_data(decoder, data);