mirror of
https://github.com/esphome/esphome.git
synced 2026-06-01 09:25:09 +08:00
Merge branch 'dev' into posix_tz
This commit is contained in:
@@ -14,6 +14,7 @@ from esphome.const import (
|
|||||||
CONF_BOARD,
|
CONF_BOARD,
|
||||||
CONF_COMPONENTS,
|
CONF_COMPONENTS,
|
||||||
CONF_DISABLED,
|
CONF_DISABLED,
|
||||||
|
CONF_ENABLE_OTA_ROLLBACK,
|
||||||
CONF_ESPHOME,
|
CONF_ESPHOME,
|
||||||
CONF_FRAMEWORK,
|
CONF_FRAMEWORK,
|
||||||
CONF_IGNORE_EFUSE_CUSTOM_MAC,
|
CONF_IGNORE_EFUSE_CUSTOM_MAC,
|
||||||
@@ -90,7 +91,6 @@ CONF_ENABLE_IDF_EXPERIMENTAL_FEATURES = "enable_idf_experimental_features"
|
|||||||
CONF_ENGINEERING_SAMPLE = "engineering_sample"
|
CONF_ENGINEERING_SAMPLE = "engineering_sample"
|
||||||
CONF_INCLUDE_BUILTIN_IDF_COMPONENTS = "include_builtin_idf_components"
|
CONF_INCLUDE_BUILTIN_IDF_COMPONENTS = "include_builtin_idf_components"
|
||||||
CONF_ENABLE_LWIP_ASSERT = "enable_lwip_assert"
|
CONF_ENABLE_LWIP_ASSERT = "enable_lwip_assert"
|
||||||
CONF_ENABLE_OTA_ROLLBACK = "enable_ota_rollback"
|
|
||||||
CONF_EXECUTE_FROM_PSRAM = "execute_from_psram"
|
CONF_EXECUTE_FROM_PSRAM = "execute_from_psram"
|
||||||
CONF_MINIMUM_CHIP_REVISION = "minimum_chip_revision"
|
CONF_MINIMUM_CHIP_REVISION = "minimum_chip_revision"
|
||||||
CONF_RELEASE = "release"
|
CONF_RELEASE = "release"
|
||||||
|
|||||||
@@ -24,8 +24,29 @@ namespace http_request {
|
|||||||
static const char *const TAG = "http_request.update";
|
static const char *const TAG = "http_request.update";
|
||||||
|
|
||||||
static const size_t MAX_READ_SIZE = 256;
|
static const size_t MAX_READ_SIZE = 256;
|
||||||
|
static constexpr uint32_t INITIAL_CHECK_INTERVAL_ID = 0;
|
||||||
|
static constexpr uint32_t INITIAL_CHECK_INTERVAL_MS = 10000;
|
||||||
|
static constexpr uint8_t INITIAL_CHECK_MAX_ATTEMPTS = 6;
|
||||||
|
|
||||||
void HttpRequestUpdate::setup() { this->ota_parent_->add_state_listener(this); }
|
void HttpRequestUpdate::setup() {
|
||||||
|
this->ota_parent_->add_state_listener(this);
|
||||||
|
|
||||||
|
// Check periodically until network is ready
|
||||||
|
// Only if update interval is > total retry window to avoid redundant checks
|
||||||
|
if (this->get_update_interval() != SCHEDULER_DONT_RUN &&
|
||||||
|
this->get_update_interval() > INITIAL_CHECK_INTERVAL_MS * INITIAL_CHECK_MAX_ATTEMPTS) {
|
||||||
|
this->initial_check_remaining_ = INITIAL_CHECK_MAX_ATTEMPTS;
|
||||||
|
this->set_interval(INITIAL_CHECK_INTERVAL_ID, INITIAL_CHECK_INTERVAL_MS, [this]() {
|
||||||
|
bool connected = network::is_connected();
|
||||||
|
if (--this->initial_check_remaining_ == 0 || connected) {
|
||||||
|
this->cancel_interval(INITIAL_CHECK_INTERVAL_ID);
|
||||||
|
if (connected) {
|
||||||
|
this->update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void HttpRequestUpdate::on_ota_state(ota::OTAState state, float progress, uint8_t error) {
|
void HttpRequestUpdate::on_ota_state(ota::OTAState state, float progress, uint8_t error) {
|
||||||
if (state == ota::OTAState::OTA_IN_PROGRESS) {
|
if (state == ota::OTAState::OTA_IN_PROGRESS) {
|
||||||
@@ -45,6 +66,7 @@ void HttpRequestUpdate::update() {
|
|||||||
ESP_LOGD(TAG, "Network not connected, skipping update check");
|
ESP_LOGD(TAG, "Network not connected, skipping update check");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this->cancel_interval(INITIAL_CHECK_INTERVAL_ID);
|
||||||
#ifdef USE_ESP32
|
#ifdef USE_ESP32
|
||||||
xTaskCreate(HttpRequestUpdate::update_task, "update_task", 8192, (void *) this, 1, &this->update_task_handle_);
|
xTaskCreate(HttpRequestUpdate::update_task, "update_task", 8192, (void *) this, 1, &this->update_task_handle_);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class HttpRequestUpdate final : public update::UpdateEntity, public PollingCompo
|
|||||||
#ifdef USE_ESP32
|
#ifdef USE_ESP32
|
||||||
TaskHandle_t update_task_handle_{nullptr};
|
TaskHandle_t update_task_handle_{nullptr};
|
||||||
#endif
|
#endif
|
||||||
|
uint8_t initial_check_remaining_{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace http_request
|
} // namespace http_request
|
||||||
|
|||||||
@@ -20,8 +20,6 @@ __attribute__((weak)) void print_coredump() {}
|
|||||||
|
|
||||||
namespace esphome::logger {
|
namespace esphome::logger {
|
||||||
|
|
||||||
static const uint32_t CRASH_MAGIC = 0xDEADBEEF;
|
|
||||||
|
|
||||||
__attribute__((section(".noinit"))) struct {
|
__attribute__((section(".noinit"))) struct {
|
||||||
uint32_t magic;
|
uint32_t magic;
|
||||||
uint32_t reason;
|
uint32_t reason;
|
||||||
@@ -152,7 +150,7 @@ static const char *reason_to_str(unsigned int reason, char *buf) {
|
|||||||
|
|
||||||
void Logger::dump_crash_() {
|
void Logger::dump_crash_() {
|
||||||
ESP_LOGD(TAG, "Crash buffer address %p", &crash_buf);
|
ESP_LOGD(TAG, "Crash buffer address %p", &crash_buf);
|
||||||
if (crash_buf.magic == CRASH_MAGIC) {
|
if (crash_buf.magic == App.get_config_hash()) {
|
||||||
char reason_buf[REASON_BUF_SIZE];
|
char reason_buf[REASON_BUF_SIZE];
|
||||||
ESP_LOGE(TAG, "Last crash:");
|
ESP_LOGE(TAG, "Last crash:");
|
||||||
ESP_LOGE(TAG, "Reason=%s PC=0x%08x LR=0x%08x", reason_to_str(crash_buf.reason, reason_buf), crash_buf.pc,
|
ESP_LOGE(TAG, "Reason=%s PC=0x%08x LR=0x%08x", reason_to_str(crash_buf.reason, reason_buf), crash_buf.pc,
|
||||||
@@ -164,7 +162,7 @@ void Logger::dump_crash_() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void k_sys_fatal_error_handler(unsigned int reason, const z_arch_esf_t *esf) {
|
void k_sys_fatal_error_handler(unsigned int reason, const z_arch_esf_t *esf) {
|
||||||
crash_buf.magic = CRASH_MAGIC;
|
crash_buf.magic = App.get_config_hash();
|
||||||
crash_buf.reason = reason;
|
crash_buf.reason = reason;
|
||||||
if (esf) {
|
if (esf) {
|
||||||
crash_buf.pc = esf->basic.pc;
|
crash_buf.pc = esf->basic.pc;
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ async def to_code(config):
|
|||||||
|
|
||||||
FILTER_SOURCE_FILES = filter_source_files_from_platform(
|
FILTER_SOURCE_FILES = filter_source_files_from_platform(
|
||||||
{
|
{
|
||||||
"remote_receiver_esp32.cpp": {
|
"remote_receiver_rmt.cpp": {
|
||||||
PlatformFramework.ESP32_ARDUINO,
|
PlatformFramework.ESP32_ARDUINO,
|
||||||
PlatformFramework.ESP32_IDF,
|
PlatformFramework.ESP32_IDF,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ async def to_code(config):
|
|||||||
|
|
||||||
FILTER_SOURCE_FILES = filter_source_files_from_platform(
|
FILTER_SOURCE_FILES = filter_source_files_from_platform(
|
||||||
{
|
{
|
||||||
"remote_transmitter_esp32.cpp": {
|
"remote_transmitter_rmt.cpp": {
|
||||||
PlatformFramework.ESP32_ARDUINO,
|
PlatformFramework.ESP32_ARDUINO,
|
||||||
PlatformFramework.ESP32_IDF,
|
PlatformFramework.ESP32_IDF,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -354,6 +354,7 @@ CONF_ELSE = "else"
|
|||||||
CONF_ENABLE_BTM = "enable_btm"
|
CONF_ENABLE_BTM = "enable_btm"
|
||||||
CONF_ENABLE_IPV6 = "enable_ipv6"
|
CONF_ENABLE_IPV6 = "enable_ipv6"
|
||||||
CONF_ENABLE_ON_BOOT = "enable_on_boot"
|
CONF_ENABLE_ON_BOOT = "enable_on_boot"
|
||||||
|
CONF_ENABLE_OTA_ROLLBACK = "enable_ota_rollback"
|
||||||
CONF_ENABLE_PIN = "enable_pin"
|
CONF_ENABLE_PIN = "enable_pin"
|
||||||
CONF_ENABLE_PRIVATE_NETWORK_ACCESS = "enable_private_network_access"
|
CONF_ENABLE_PRIVATE_NETWORK_ACCESS = "enable_private_network_access"
|
||||||
CONF_ENABLE_RRM = "enable_rrm"
|
CONF_ENABLE_RRM = "enable_rrm"
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ platformio==6.1.19
|
|||||||
esptool==5.2.0
|
esptool==5.2.0
|
||||||
click==8.1.7
|
click==8.1.7
|
||||||
esphome-dashboard==20260210.0
|
esphome-dashboard==20260210.0
|
||||||
aioesphomeapi==44.0.0
|
aioesphomeapi==44.1.0
|
||||||
zeroconf==0.148.0
|
zeroconf==0.148.0
|
||||||
puremagic==1.30
|
puremagic==1.30
|
||||||
ruamel.yaml==0.19.1 # dashboard_import
|
ruamel.yaml==0.19.1 # dashboard_import
|
||||||
|
|||||||
Reference in New Issue
Block a user