From 710096b1c6035d71c7ed4912e8940fdb83ead3ae Mon Sep 17 00:00:00 2001 From: Andreas Hergert <36455093+andreashergert1984@users.noreply.github.com> Date: Tue, 23 Nov 2021 09:20:55 +0100 Subject: [PATCH] Fixed wrong setup of tc9548a (#2766) --- esphome/components/tca9548a/tca9548a.cpp | 2 +- esphome/components/tca9548a/tca9548a.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/components/tca9548a/tca9548a.cpp b/esphome/components/tca9548a/tca9548a.cpp index e902eb5ed4..f3f8685287 100644 --- a/esphome/components/tca9548a/tca9548a.cpp +++ b/esphome/components/tca9548a/tca9548a.cpp @@ -22,7 +22,7 @@ i2c::ErrorCode TCA9548AChannel::writev(uint8_t address, i2c::WriteBuffer *buffer void TCA9548AComponent::setup() { ESP_LOGCONFIG(TAG, "Setting up TCA9548A..."); uint8_t status = 0; - if (this->read_register(0x00, &status, 1) != i2c::ERROR_OK) { + if (this->read(&status, 1) != i2c::ERROR_OK) { ESP_LOGI(TAG, "TCA9548A failed"); this->mark_failed(); return; diff --git a/esphome/components/tca9548a/tca9548a.h b/esphome/components/tca9548a/tca9548a.h index 314346d317..39d07c2eb4 100644 --- a/esphome/components/tca9548a/tca9548a.h +++ b/esphome/components/tca9548a/tca9548a.h @@ -24,6 +24,7 @@ class TCA9548AComponent : public Component, public i2c::I2CDevice { public: void setup() override; void dump_config() override; + float get_setup_priority() const override { return setup_priority::IO; } void update(); i2c::ErrorCode switch_to_channel(uint8_t channel);