[Firmware] Adapt Decoder for Climate+Alarm Sensors
This commit is contained in:
parent
4e25baf91e
commit
9a51210f38
|
@ -37,6 +37,10 @@ function Decoder(bytes, port) {
|
|||
if (bytes.length >= 9)
|
||||
decoded.h = ((bytes[5]) | (bytes[6] << 8 ) | (bytes[7] << 16 ) | (bytes[8] << 24)) / 100.0;
|
||||
|
||||
// Alarm Triggered (uint8_t)
|
||||
if (bytes.length == 10)
|
||||
decoded.a = bytes[9];
|
||||
|
||||
// SHT21 + Brightness (int16_t)
|
||||
if (bytes.length == 11)
|
||||
decoded.b = ((bytes[9]) | (bytes[10] << 8 ));
|
||||
|
@ -45,6 +49,10 @@ function Decoder(bytes, port) {
|
|||
if (bytes.length >= 13)
|
||||
decoded.p = ((bytes[9]) | (bytes[10] << 8 ) | (bytes[11] << 16 ) | (bytes[12] << 24)) / 100.0;
|
||||
|
||||
// Alarm Triggered (uint8_t)
|
||||
if (bytes.length == 14)
|
||||
decoded.a = bytes[13];
|
||||
|
||||
// BME280 + Brightness (int16_t)
|
||||
if (bytes.length == 15)
|
||||
decoded.b = ((bytes[13]) | (bytes[14] << 8 ));
|
||||
|
|
Loading…
Reference in a new issue