Compare commits

...

7 Commits

Author SHA1 Message Date
Jesse Hills
1ef6fd8fb0 Merge pull request #3261 from esphome/bump-2022.2.6
2022.2.6
2022-03-02 22:54:51 +13:00
Jesse Hills
942b0de7fd Bump version to 2022.2.6 2022-03-02 17:07:08 +13:00
Jesse Hills
859cca49d1 Only get free memory size from internal (#3259) 2022-03-02 17:07:08 +13:00
Jesse Hills
8f7ff25624 Merge pull request #3252 from esphome/bump-2022.2.5
2022.2.5
2022-02-24 07:28:56 +13:00
Jesse Hills
97aca8e54c Bump version to 2022.2.5 2022-02-23 11:20:48 +13:00
Nicholas Peters
95acf19067 Fix regression caused by TSL2591 auto gain (#3249) 2022-02-23 11:20:48 +13:00
Martin Weinelt
3d0899aa58 Respect ESPHOME_USE_SUBPROCESS in esp32 post_build script (#3246) 2022-02-23 11:20:48 +13:00
4 changed files with 33 additions and 7 deletions

View File

@@ -1,6 +1,10 @@
# Source https://github.com/letscontrolit/ESPEasy/pull/3845#issuecomment-1005864664
import esptool
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

@@ -22,7 +22,7 @@ std::string build_json(const json_build_t &f) {
#ifdef USE_ESP8266
const size_t free_heap = ESP.getMaxFreeBlockSize() - 2048; // NOLINT(readability-static-accessed-through-instance)
#elif defined(USE_ESP32)
const size_t free_heap = heap_caps_get_largest_free_block(MALLOC_CAP_DEFAULT) - 2048;
const size_t free_heap = heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL) - 2048;
#endif
DynamicJsonDocument json_document(free_heap);
@@ -42,7 +42,7 @@ void parse_json(const std::string &data, const json_parse_t &f) {
#ifdef USE_ESP8266
const size_t free_heap = ESP.getMaxFreeBlockSize() - 2048; // NOLINT(readability-static-accessed-through-instance)
#elif defined(USE_ESP32)
const size_t free_heap = heap_caps_get_largest_free_block(MALLOC_CAP_DEFAULT) - 2048;
const size_t free_heap = heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL) - 2048;
#endif
DynamicJsonDocument json_document(free_heap);

View File

@@ -43,16 +43,34 @@ void TSL2591Component::disable_if_power_saving_() {
}
void TSL2591Component::setup() {
if (this->component_gain_ == TSL2591_CGAIN_AUTO)
this->gain_ = TSL2591_GAIN_MED;
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.6"
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"