Reflect PVVX firmware reed switch status

The first bit of the flag field reflects reed switch status so this
device can additionally be used to monitor the status of a door.
This commit is contained in:
Lenbok 2021-10-29 19:43:10 +13:00
parent ab6b2d1321
commit 628c00f090
1 changed files with 5 additions and 1 deletions

View File

@ -1586,6 +1586,10 @@ void MI32ParseATCPacket(const uint8_t * _buf, uint32_t length, const uint8_t *ad
MIBLEsensors[_slot].bat = ppv_packet->battery_level;
MIBLEsensors[_slot].eventType.bat = 1;
MIBLEsensors[_slot].Btn = (ppv_packet->flags) & 0x1; // First bit is reed switch status
MIBLEsensors[_slot].eventType.Btn = 1;
MIBLEsensors[_slot].feature.Btn = 1;
if(MI32.option.directBridgeMode) {
MIBLEsensors[_slot].shallSendMQTT = 1;
MI32.mode.shallTriggerTele = 1;