DT24 - Update messages to support temp (#991)

With the additional functionality added by @h2zero I’m able to extract
the temperate data from the 2nd part of the bluetooth message.

Co-authored-by: Northern Man <sgracey@Heisenberg.local>
This commit is contained in:
Northern ManandNorthern Man authored and GitHub committed 2021-06-18 21:20:07 -05:00
1 parent 792807e6e5
commit ac23235327
2 files changed
+5 -2

No files matched your search

+2
View File
@@ -126,6 +126,8 @@ void DT24_connect::notifyCB(NimBLERemoteCharacteristic* pChar, uint8_t* pData, s
BLEdata.set("power", (float)(((m_data[10] * 256 * 256) + (m_data[11] * 256) + m_data[12]) / 10.0));
BLEdata.set("energy", (float)(((m_data[13] * 256 * 256 * 256) + (m_data[14] * 256 * 256) + (m_data[15] * 256) + m_data[16]) / 100.0));
BLEdata.set("price", (float)(((m_data[17] * 256 * 256) + (m_data[18] * 256) + m_data[19]) / 100.0));
BLEdata.set("tempc", (float)(m_data[24] * 256) + m_data[25]);
BLEdata.set("tempf", (float)(convertTemp_CtoF((m_data[24] * 256) + m_data[25])));
pubBT(BLEdata);
} else {