diff --git a/esphome/components/esp32_ble_client/ble_client_base.cpp b/esphome/components/esp32_ble_client/ble_client_base.cpp index dd6fc94127..017d65573d 100644 --- a/esphome/components/esp32_ble_client/ble_client_base.cpp +++ b/esphome/components/esp32_ble_client/ble_client_base.cpp @@ -290,14 +290,17 @@ float BLEClientBase::parse_char_value(uint8_t *value, uint16_t length) { if (length > 2) { return (float) encode_uint16(value[1], value[2]); } + // fall through case 0x7: // uint24. if (length > 3) { return (float) encode_uint24(value[1], value[2], value[3]); } + // fall through case 0x8: // uint32. if (length > 4) { return (float) encode_uint32(value[1], value[2], value[3], value[4]); } + // fall through case 0xC: // int8. return (float) ((int8_t) value[1]); case 0xD: // int12. @@ -305,10 +308,12 @@ float BLEClientBase::parse_char_value(uint8_t *value, uint16_t length) { if (length > 2) { return (float) ((int16_t)(value[1] << 8) + (int16_t) value[2]); } + // fall through case 0xF: // int24. if (length > 3) { return (float) ((int32_t)(value[1] << 16) + (int32_t)(value[2] << 8) + (int32_t)(value[3])); } + // fall through case 0x10: // int32. if (length > 4) { return (float) ((int32_t)(value[1] << 24) + (int32_t)(value[2] << 16) + (int32_t)(value[3] << 8) +