mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 01:07:45 +01:00
SHTC3: Wake up the sensor during setup (#993)
Since we put the sensor to sleep when not measuring, make sure to wake it up during setup. It does not respond to any other I2C commands (including reset) while asleep, so if we've done a soft reboot while it was sleeping then setup() would fail since it wouldn't respond to anything.
This commit is contained in:
parent
6123cb7c69
commit
c9e224e999
1 changed files with 1 additions and 0 deletions
|
@ -25,6 +25,7 @@ inline const char *to_string(SHTCXType type) {
|
|||
|
||||
void SHTCXComponent::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Setting up SHTCx...");
|
||||
this->wake_up();
|
||||
this->soft_reset();
|
||||
|
||||
if (!this->write_command_(SHTCX_COMMAND_READ_ID_REGISTER)) {
|
||||
|
|
Loading…
Reference in a new issue