Merge pull request #3252 from esphome/bump-2022.2.5

2022.2.5
This commit is contained in:
Jesse Hills 2022-02-24 07:28:56 +13:00 committed by GitHub
commit 8f7ff25624
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 5 deletions

View file

@ -1,6 +1,10 @@
# Source https://github.com/letscontrolit/ESPEasy/pull/3845#issuecomment-1005864664
import os
if os.environ.get("ESPHOME_USE_SUBPROCESS") is None:
import esptool
else:
import subprocess
from SCons.Script import ARGUMENTS
# pylint: disable=E0602
@ -42,8 +46,11 @@ def esp32_create_combined_bin(source, target, env):
print()
print(f"Using esptool.py arguments: {' '.join(cmd)}")
print()
esptool.main(cmd)
if os.environ.get("ESPHOME_USE_SUBPROCESS") is None:
esptool.main(cmd)
else:
subprocess.run(["esptool.py", *cmd])
# pylint: disable=E0602
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", esp32_create_combined_bin) # noqa

View file

@ -43,16 +43,34 @@ void TSL2591Component::disable_if_power_saving_() {
}
void TSL2591Component::setup() {
if (this->component_gain_ == TSL2591_CGAIN_AUTO)
switch (this->component_gain_) {
case TSL2591_CGAIN_LOW:
this->gain_ = TSL2591_GAIN_LOW;
break;
case TSL2591_CGAIN_MED:
this->gain_ = TSL2591_GAIN_MED;
break;
case TSL2591_CGAIN_HIGH:
this->gain_ = TSL2591_GAIN_HIGH;
break;
case TSL2591_CGAIN_MAX:
this->gain_ = TSL2591_GAIN_MAX;
break;
case TSL2591_CGAIN_AUTO:
this->gain_ = TSL2591_GAIN_MED;
break;
}
uint8_t address = this->address_;
ESP_LOGI(TAG, "Setting up TSL2591 sensor at I2C address 0x%02X", address);
uint8_t id;
if (!this->read_byte(TSL2591_COMMAND_BIT | TSL2591_REGISTER_DEVICE_ID, &id)) {
ESP_LOGE(TAG, "Failed I2C read during setup()");
this->mark_failed();
return;
}
if (id != 0x50) {
ESP_LOGE(TAG,
"Could not find the TSL2591 sensor. The ID register of the device at address 0x%02X reported 0x%02X "
@ -61,6 +79,7 @@ void TSL2591Component::setup() {
this->mark_failed();
return;
}
this->set_integration_time_and_gain(this->integration_time_, this->gain_);
this->disable_if_power_saving_();
}

View file

@ -1,6 +1,6 @@
"""Constants used by esphome."""
__version__ = "2022.2.4"
__version__ = "2022.2.5"
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"