diff --git a/esphome/components/mcp4461/mcp4461.cpp b/esphome/components/mcp4461/mcp4461.cpp index 7e33beb32e..98b5c64314 100644 --- a/esphome/components/mcp4461/mcp4461.cpp +++ b/esphome/components/mcp4461/mcp4461.cpp @@ -127,12 +127,14 @@ uint8_t Mcp4461Component::get_status_register() { return 0; } uint8_t msb = buf >> 8; - if (msb != 1) { - // D8 bit is hardlocked to 1 -> a status msb of 0 indicates device/communication issues, therefore mark component failed + uint8_t lsb; + lsb = static_cast(buf & 0x00ff); + if (msb != 1 || ((lsb >> 7) & 0x01)) != 1 || ((lsb >> 1) & 0x01) != 1) { + // D8, D7 and R1 bits are hardlocked to 1 -> a status msb bit 0 (bit 9 of status register) of 0 or lsb bit 1/7 = 0 indicate device/communication issues, therefore mark component failed this->mark_failed(); return 0; } - return static_cast(buf & 0x00ff); + return ; } bool Mcp4461Component::is_writing_() { return static_cast((this->get_status_register() >> 4) & 0x01); }