diff --git a/esphome/components/sensirion_common/i2c_sensirion.cpp b/esphome/components/sensirion_common/i2c_sensirion.cpp index 9eac6b4525..e39a3ce0a0 100644 --- a/esphome/components/sensirion_common/i2c_sensirion.cpp +++ b/esphome/components/sensirion_common/i2c_sensirion.cpp @@ -57,24 +57,14 @@ bool SensirionI2CDevice::write_command_(uint16_t command, CommandLen command_len temp[raw_idx++] = command & 0xFF; } else { // command is 2 bytes -#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ temp[raw_idx++] = command >> 8; temp[raw_idx++] = command & 0xFF; -#else - temp[raw_idx++] = command & 0xFF; - temp[raw_idx++] = command >> 8; -#endif } // add parameters followed by crc // skipped if len == 0 for (size_t i = 0; i < data_len; i++) { -#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ temp[raw_idx++] = data[i] >> 8; temp[raw_idx++] = data[i] & 0xFF; -#else - temp[raw_idx++] = data[i] & 0xFF; - temp[raw_idx++] = data[i] >> 8; -#endif // Use MSB first since Sensirion devices use CRC-8 with MSB first uint8_t crc = crc8(&temp[raw_idx - 2], 2, 0xFF, CRC_POLYNOMIAL, true); temp[raw_idx++] = crc;