12 ESP_LOGW(TAG,
"Read failed");
bool status_comm_result(bool ok)
Clears the warning when ok, else sets it with message (default "Communication failed"); returns ok.
ErrorCode read(uint8_t *data, size_t len) const
reads an array of bytes from the device using an I2CBus
void publish_state(float state)
Publish a new state to the front-end.
@ ERROR_OK
No error found during execution of method.
ESPHOME_LOG_TAG(TAG, "mcp3221")
constexpr uint16_t encode_uint16(uint8_t msb, uint8_t lsb)
Encode a 16-bit value given the most and least significant byte.