diff --git a/tasmota/include/xsns_62_esp32_mi.h b/tasmota/include/xsns_62_esp32_mi.h index ef372036e..2b9ec9e99 100644 --- a/tasmota/include/xsns_62_esp32_mi.h +++ b/tasmota/include/xsns_62_esp32_mi.h @@ -141,12 +141,15 @@ struct ATCPacket_t{ //and PVVX }; }; -struct BTHome_info_t{ - uint8_t encrypted:1; - uint8_t reserved:1; - uint8_t triggered:1; - uint8_t reserved2:2; - uint8_t version:2; +union BTHome_info_t{ + struct{ + uint8_t encrypted:1; + uint8_t reserved:1; + uint8_t triggered:1; + uint8_t reserved2:2; + uint8_t version:2; + }; + char byte_value; }; struct BLERingBufferItem_t{ diff --git a/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino b/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino index 04b31918a..1ee386063 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino @@ -1827,7 +1827,8 @@ void MI32parseBTHomePacket(char * _buf, uint32_t length, uint8_t addr[6], int RS MIBLEsensors[_slot].RSSI = RSSI; MIBLEsensors[_slot].lastTime = millis(); - BTHome_info_t info = (BTHome_info_t)_buf[0]; + BTHome_info_t info; + info.byte_value = _buf[0]; MIBLEsensors[_slot].feature.needsKey = info.encrypted; uint32_t idx = 1;