From f72fe694cb0d3e0648eb7846f362d2deb34e2f7e Mon Sep 17 00:00:00 2001 From: "Christian W. Zuckschwerdt" Date: Sun, 16 Dec 2018 13:13:55 +0100 Subject: [PATCH] Move channel next to id in Mebus, Nexus --- src/devices/mebus.c | 15 ++++++++++++++- src/devices/nexus.c | 6 +++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/devices/mebus.c b/src/devices/mebus.c index 244f0fd0..3cf334e4 100644 --- a/src/devices/mebus.c +++ b/src/devices/mebus.c @@ -34,8 +34,8 @@ static int mebus433_callback(r_device *decoder, bitbuffer_t *bitbuffer) { data = data_make( "model", "", DATA_STRING, "Mebus/433", "id", "Address", DATA_INT, address, - "battery", "Battery", DATA_STRING, battery ? "OK" : "LOW", "channel", "Channel", DATA_INT, channel, + "battery", "Battery", DATA_STRING, battery ? "OK" : "LOW", "unknown1", "Unknown 1", DATA_INT, unknown1, "unknown2", "Unknown 2", DATA_INT, unknown2, "temperature_C", "Temperature", DATA_FORMAT, "%.02f C", DATA_DOUBLE, temp / 10.0, @@ -49,6 +49,18 @@ static int mebus433_callback(r_device *decoder, bitbuffer_t *bitbuffer) { return 0; } +static char *output_fields[] = { + "model", + "id", + "channel", + "battery", + "unknown1", + "unknown2", + "temperature_C", + "humidity", + NULL +}; + r_device mebus433 = { .name = "Mebus 433", .modulation = OOK_PULSE_PPM, @@ -58,4 +70,5 @@ r_device mebus433 = { .reset_limit = 6000, .decode_fn = &mebus433_callback, .disabled = 1, // add docs, tests, false positive checks and then reenable + .fields = output_fields }; diff --git a/src/devices/nexus.c b/src/devices/nexus.c index 84fbef61..cfc9ce00 100644 --- a/src/devices/nexus.c +++ b/src/devices/nexus.c @@ -78,8 +78,8 @@ static int nexus_callback(r_device *decoder, bitbuffer_t *bitbuffer) { data = data_make( "model", "", DATA_STRING, "Nexus Temperature", "id", "House Code", DATA_INT, id, - "battery", "Battery", DATA_STRING, battery ? "OK" : "LOW", "channel", "Channel", DATA_INT, channel, + "battery", "Battery", DATA_STRING, battery ? "OK" : "LOW", "temperature_C", "Temperature", DATA_FORMAT, "%.02f C", DATA_DOUBLE, temp/10.0, NULL); decoder_output_data(decoder, data); @@ -89,8 +89,8 @@ static int nexus_callback(r_device *decoder, bitbuffer_t *bitbuffer) { data = data_make( "model", "", DATA_STRING, "Nexus Temperature/Humidity", "id", "House Code", DATA_INT, id, - "battery", "Battery", DATA_STRING, battery ? "OK" : "LOW", "channel", "Channel", DATA_INT, channel, + "battery", "Battery", DATA_STRING, battery ? "OK" : "LOW", "temperature_C", "Temperature", DATA_FORMAT, "%.02f C", DATA_DOUBLE, temp/10.0, "humidity", "Humidity", DATA_FORMAT, "%u %%", DATA_INT, humidity, NULL); @@ -104,8 +104,8 @@ static int nexus_callback(r_device *decoder, bitbuffer_t *bitbuffer) { static char *output_fields[] = { "model", "id", - "battery", "channel", + "battery", "temperature_C", "humidity", NULL