Move channel next to id in Mebus, Nexus

This commit is contained in:
Christian W. Zuckschwerdt
2018-12-16 13:13:55 +01:00
parent 22cc97a283
commit f72fe694cb
2 changed files with 17 additions and 4 deletions

View File

@@ -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
};

View File

@@ -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