1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-17 15:26:01 +00:00

Compare commits

..

23 Commits

Author SHA1 Message Date
J. Nick Koston
8b1f3b2b08 Merge branch 'bh1750_loop' into integration 2025-11-17 09:20:55 -06:00
J. Nick Koston
499ad18475 Merge branch 'dashboard_import_url_store_rodata' into integration 2025-11-17 09:13:30 -06:00
J. Nick Koston
0afaf182da Merge branch 'dev' into dashboard_import_url_store_rodata 2025-11-17 09:12:57 -06:00
J. Nick Koston
43f2405dc3 [dashboard_import] Store package import URL in .rodata instead of RAM 2025-11-17 09:10:51 -06:00
J. Nick Koston
41ac12a0e1 Update esphome/components/bh1750/bh1750.cpp 2025-11-17 08:48:42 -06:00
J. Nick Koston
a6f416a09e Update esphome/components/bh1750/bh1750.cpp 2025-11-17 08:48:13 -06:00
Javier Peletier
9e1f8d83f8 [config] Support !remove and !extend with LVGL-style configs (#11534) 2025-11-17 18:03:11 +11:00
Jesse Hills
fa0aa6defc Merge branch 'beta' into dev 2025-11-17 17:41:46 +13:00
Jesse Hills
70366d2124 Merge pull request #11944 from esphome/bump-2025.11.0b3
2025.11.0b3
2025-11-17 17:41:11 +13:00
Jesse Hills
a38c4e0c6e Bump version to 2025.11.0b3 2025-11-17 15:32:09 +13:00
Anton Sergunov
6c6b03bda0 [uart] Setup uart pins only if flags are set (#11914)
Co-authored-by: J. Nick Koston <nick+github@koston.org>
2025-11-17 15:32:09 +13:00
J. Nick Koston
9e02e31917 [web_server_idf] Fix lwIP assertion crash by shutting down sockets on connection close (#11937) 2025-11-17 15:32:09 +13:00
J. Nick Koston
3fd58f1a91 [web_server.ota] Merge multiple instances to prevent undefined behavior (#11905) 2025-11-17 15:32:09 +13:00
J. Nick Koston
9151489481 [sntp] Merge multiple instances to fix crash and undefined behavior (#11904) 2025-11-17 15:32:09 +13:00
J. Nick Koston
f19296ac7f [analyze-memory] Show all core symbols > 100 B instead of top 15 (#11909) 2025-11-17 15:32:09 +13:00
J. Nick Koston
36868ee7b1 [scheduler] Fix timing breakage after 49 days of uptime on ESP8266/RP2040 (#11924) 2025-11-17 15:32:09 +13:00
J. Nick Koston
d559f9f52e [ld2410] Add timeout filter to prevent stuck targets (#11920) 2025-11-17 15:32:09 +13:00
J. Nick Koston
6440b5fbf5 [ld2412] Fix stuck targets by adding timeout filter (#11919) 2025-11-17 15:32:09 +13:00
Jonathan Swoboda
97c4914573 [uart] Improve error handling and validate buffer size (#11895)
Co-authored-by: J. Nick Koston <nick+github@koston.org>
2025-11-17 15:32:09 +13:00
Edward Firmo
7ce94c27fe [wifi] Allow use_psram with Arduino (#11902) 2025-11-17 15:32:09 +13:00
Edward Firmo
eb54c0026d [light] Fix missing ColorMode::BRIGHTNESS case in logging (#11836) 2025-11-17 15:32:09 +13:00
Clyde Stubbs
fe00e209ff [esp32] Add sdkconfig flag to make OTA work for 32MB flash (#11883)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2025-11-17 15:32:08 +13:00
Clyde Stubbs
aed80732f9 [esp32] Make esp-idf default framework for P4 (#11884) 2025-11-17 15:32:08 +13:00
11 changed files with 121 additions and 123 deletions

View File

@@ -1,7 +1,6 @@
"""CLI interface for memory analysis with report generation."""
from collections import defaultdict
import json
import sys
from . import (
@@ -298,28 +297,6 @@ class MemoryAnalyzerCLI(MemoryAnalyzer):
return "\n".join(lines)
def to_json(self) -> str:
"""Export analysis results as JSON."""
data = {
"components": {
name: {
"text": mem.text_size,
"rodata": mem.rodata_size,
"data": mem.data_size,
"bss": mem.bss_size,
"flash_total": mem.flash_total,
"ram_total": mem.ram_total,
"symbol_count": mem.symbol_count,
}
for name, mem in self.components.items()
},
"totals": {
"flash": sum(c.flash_total for c in self.components.values()),
"ram": sum(c.ram_total for c in self.components.values()),
},
}
return json.dumps(data, indent=2)
def dump_uncategorized_symbols(self, output_file: str | None = None) -> None:
"""Dump uncategorized symbols for analysis."""
# Sort by size descending

View File

@@ -131,7 +131,8 @@ void BH1750Sensor::loop() {
this->process_coarse_result_(lx);
// Start fine measurement with optimal settings
if (!this->start_measurement_(this->fine_mode_, this->fine_mtreg_, now)) {
// fetch millis() again since the read can take a bit
if (!this->start_measurement_(this->fine_mode_, this->fine_mtreg_, millis())) {
this->fail_and_reset_();
break;
}

View File

@@ -389,7 +389,8 @@ bool BLEClientBase::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_
if (this->conn_id_ != param->search_res.conn_id)
return false;
this->service_count_++;
if (this->connection_type_ == espbt::ConnectionType::V3_WITHOUT_CACHE) {
if (this->connection_type_ == espbt::ConnectionType::V3_WITHOUT_CACHE ||
this->connection_type_ == espbt::ConnectionType::V3_WITH_CACHE) {
// V3 clients don't need services initialized since
// as they use the ESP APIs to get services.
break;

View File

@@ -15,10 +15,7 @@ Trigger<std::vector<uint8_t>, uint16_t> *BLETriggers::create_characteristic_on_w
Trigger<std::vector<uint8_t>, uint16_t> *on_write_trigger = // NOLINT(cppcoreguidelines-owning-memory)
new Trigger<std::vector<uint8_t>, uint16_t>();
characteristic->on_write([on_write_trigger](std::span<const uint8_t> data, uint16_t id) {
// Convert span to vector for trigger - copy is necessary because:
// 1. Trigger stores the data for use in automation actions that execute later
// 2. The span is only valid during this callback (points to temporary BLE stack data)
// 3. User lambdas in automations need persistent data they can access asynchronously
// Convert span to vector for trigger
on_write_trigger->trigger(std::vector<uint8_t>(data.begin(), data.end()), id);
});
return on_write_trigger;
@@ -30,10 +27,7 @@ Trigger<std::vector<uint8_t>, uint16_t> *BLETriggers::create_descriptor_on_write
Trigger<std::vector<uint8_t>, uint16_t> *on_write_trigger = // NOLINT(cppcoreguidelines-owning-memory)
new Trigger<std::vector<uint8_t>, uint16_t>();
descriptor->on_write([on_write_trigger](std::span<const uint8_t> data, uint16_t id) {
// Convert span to vector for trigger - copy is necessary because:
// 1. Trigger stores the data for use in automation actions that execute later
// 2. The span is only valid during this callback (points to temporary BLE stack data)
// 3. User lambdas in automations need persistent data they can access asynchronously
// Convert span to vector for trigger
on_write_trigger->trigger(std::vector<uint8_t>(data.begin(), data.end()), id);
});
return on_write_trigger;

View File

@@ -174,6 +174,9 @@ FINAL_VALIDATE_SCHEMA = _final_validate
async def to_code(config):
cg.add_define("USE_OPENTHREAD")
# OpenThread uses esp_vfs_eventfd which requires VFS select support
require_vfs_select()
# OpenThread SRP needs access to mDNS services after setup
enable_mdns_storage()

View File

@@ -338,21 +338,44 @@ def check_replaceme(value):
)
def _build_list_index(lst):
def _get_item_id(item: Any) -> str | Extend | Remove | None:
"""Attempts to get a list item's ID"""
if not isinstance(item, dict):
return None # not a dict, can't have ID
# 1.- Check regular case:
# - id: my_id
item_id = item.get(CONF_ID)
if item_id is None and len(item) == 1:
# 2.- Check single-key dict case:
# - obj:
# id: my_id
item = next(iter(item.values()))
if isinstance(item, dict):
item_id = item.get(CONF_ID)
if isinstance(item_id, Extend):
# Remove instances of Extend so they don't overwrite the original item when merging:
del item[CONF_ID]
return item_id
def _build_list_index(
lst: list[Any],
) -> tuple[
OrderedDict[str | Extend | Remove, Any], list[tuple[int, str, Any]], set[str]
]:
index = OrderedDict()
extensions, removals = [], set()
for item in lst:
for pos, item in enumerate(lst):
if item is None:
removals.add(None)
continue
item_id = None
if isinstance(item, dict) and (item_id := item.get(CONF_ID)):
if isinstance(item_id, Extend):
extensions.append(item)
continue
if isinstance(item_id, Remove):
removals.add(item_id.value)
continue
item_id = _get_item_id(item)
if isinstance(item_id, Extend):
extensions.append((pos, item_id.value, item))
continue
if isinstance(item_id, Remove):
removals.add(item_id.value)
continue
if not item_id or item_id in index:
# no id or duplicate -> pass through with identity-based key
item_id = id(item)
@@ -360,7 +383,7 @@ def _build_list_index(lst):
return index, extensions, removals
def resolve_extend_remove(value, is_key=None):
def resolve_extend_remove(value: Any, is_key: bool = False) -> None:
if isinstance(value, ESPLiteralValue):
return # do not check inside literal blocks
if isinstance(value, list):
@@ -368,26 +391,16 @@ def resolve_extend_remove(value, is_key=None):
if extensions or removals:
# Rebuild the original list after
# processing all extensions and removals
for item in extensions:
item_id = item[CONF_ID].value
for pos, item_id, item in extensions:
if item_id in removals:
continue
old = index.get(item_id)
if old is None:
# Failed to find source for extension
# Find index of item to show error at correct position
i = next(
(
i
for i, d in enumerate(value)
if d.get(CONF_ID) == item[CONF_ID]
)
)
with cv.prepend_path(i):
with cv.prepend_path(pos):
raise cv.Invalid(
f"Source for extension of ID '{item_id}' was not found."
)
item[CONF_ID] = item_id
index[item_id] = merge_config(old, item)
for item_id in removals:
index.pop(item_id, None)

View File

@@ -94,9 +94,10 @@ class Scheduler {
} name_;
uint32_t interval;
// Split time to handle millis() rollover. The scheduler combines the 32-bit millis()
// with a 16-bit rollover counter to create a 48-bit time space (stored as 64-bit
// for compatibility). With 49.7 days per 32-bit rollover, the 16-bit counter
// supports 49.7 days × 65536 = ~8900 years. This ensures correct scheduling
// with a 16-bit rollover counter to create a 48-bit time space (using 32+16 bits).
// This is intentionally limited to 48 bits, not stored as a full 64-bit value.
// With 49.7 days per 32-bit rollover, the 16-bit counter supports
// 49.7 days × 65536 = ~8900 years. This ensures correct scheduling
// even when devices run for months. Split into two fields for better memory
// alignment on 32-bit systems.
uint32_t next_execution_low_; // Lower 32 bits of execution time (millis value)

View File

@@ -408,8 +408,7 @@ class IDEData:
def analyze_memory_usage(config: dict[str, Any]) -> None:
"""Analyze memory usage by component after compilation."""
# Lazy import to avoid overhead when not needed
from esphome.analyze_memory.cli import MemoryAnalyzerCLI
from esphome.analyze_memory.helpers import get_esphome_components
from esphome.analyze_memory import MemoryAnalyzer
idedata = get_idedata(config)
@@ -436,6 +435,8 @@ def analyze_memory_usage(config: dict[str, Any]) -> None:
external_components = set()
# Get the list of built-in ESPHome components
from esphome.analyze_memory import get_esphome_components
builtin_components = get_esphome_components()
# Special non-component keys that appear in configs
@@ -456,9 +457,7 @@ def analyze_memory_usage(config: dict[str, Any]) -> None:
_LOGGER.debug("Detected external components: %s", external_components)
# Create analyzer and run analysis
analyzer = MemoryAnalyzerCLI(
elf_path, objdump_path, readelf_path, external_components
)
analyzer = MemoryAnalyzer(elf_path, objdump_path, readelf_path, external_components)
analyzer.analyze()
# Generate and print report

View File

@@ -1,59 +0,0 @@
esphome:
name: test-user-services-union
friendly_name: Test User Services Union Storage
esp32:
board: esp32dev
framework:
type: esp-idf
logger:
level: DEBUG
wifi:
ssid: "test"
password: "password"
api:
actions:
# Test service with no arguments
- action: test_no_args
then:
- logger.log: "No args service called"
# Test service with one argument
- action: test_one_arg
variables:
value: int
then:
- logger.log:
format: "One arg service: %d"
args: [value]
# Test service with multiple arguments of different types
- action: test_multi_args
variables:
int_val: int
float_val: float
str_val: string
bool_val: bool
then:
- logger.log:
format: "Multi args: %d, %.2f, %s, %d"
args: [int_val, float_val, str_val.c_str(), bool_val]
# Test service with max typical arguments
- action: test_many_args
variables:
arg1: int
arg2: int
arg3: int
arg4: string
arg5: float
then:
- logger.log: "Many args service called"
binary_sensor:
- platform: template
name: "Test Binary Sensor"
id: test_sensor

View File

@@ -7,3 +7,27 @@ some_component:
value: 2
- id: component2
value: 5
lvgl:
pages:
- id: page1
widgets:
- obj:
id: object1
x: 3
y: 2
width: 4
- obj:
id: object3
x: 6
y: 12
widgets:
- obj:
id: object4
x: 14
y: 9
width: 15
height: 13
- obj:
id: object5
x: 10
y: 11

View File

@@ -13,6 +13,30 @@ packages:
value: 5
- id: component3
value: 6
- lvgl:
pages:
- id: page1
widgets:
- obj:
id: object1
x: 1
y: 2
- obj:
id: object2
x: 5
- obj:
id: object3
x: 6
y: 7
widgets:
- obj:
id: object4
x: 8
y: 9
- obj:
id: object5
x: 10
y: 11
some_component:
- id: !extend ${A}
@@ -20,3 +44,23 @@ some_component:
- id: component2
value: 3
- id: !remove ${C}
lvgl:
pages:
- id: !extend page1
widgets:
- obj:
id: !extend object1
x: 3
width: 4
- obj:
id: !remove object2
- obj:
id: !extend object3
y: 12
height: 13
widgets:
- obj:
id: !extend object4
x: 14
width: 15