diff --git a/gateway/include/Protocol_1.h b/gateway/include/Protocol_1.h index ba57038..6f7d317 100644 --- a/gateway/include/Protocol_1.h +++ b/gateway/include/Protocol_1.h @@ -21,7 +21,7 @@ public: RcDecoder decoder; decoder.decode(value); rcSwitch["state"] = decoder.state; - rcSwitch["group"] = String(decoder.group, BIN); + rcSwitch["group"] = decoder.group; rcSwitch["channel"] = decoder.device; rcSwitch["raw_value"] = value; } diff --git a/gateway/include/RcDecoder.h b/gateway/include/RcDecoder.h index e43e564..fd2aa62 100644 --- a/gateway/include/RcDecoder.h +++ b/gateway/include/RcDecoder.h @@ -4,7 +4,7 @@ struct RcDecoder { bool state; - char group; + char group[6]; unsigned char device; void decode(unsigned long value) { @@ -16,7 +16,7 @@ struct RcDecoder { } state = RC_STATE(res); - group = RC_GROUP(res); + sprintf(group, "%05ld", RC_GROUP(res)); switch (RC_DEVICE(res)) { case 0b10000: device = 1;