mirror of
https://github.com/esphome/esphome.git
synced 2026-09-30 16:30:22 +00:00
[core] Expand component source index to 9 bits (511 max)
Bitfield component_source_index_ (9 bits) and warn_if_blocking_over_ (7 bits) into the same 16 bits. This doubles the max unique component source names from 255 to 511 without increasing Component size. The blocking warn threshold max drops from 2550ms to 1270ms which is more than sufficient since it starts at 50ms and ratchets up. Fixes test warnings when many components are compiled together: WARNING Too many unique component source names (max 255)
This commit is contained in:
@@ -137,7 +137,7 @@ def test_register_component_source_overflow_warns(
|
||||
) -> None:
|
||||
# Pre-fill pool to max
|
||||
pool = ComponentSourcePool(
|
||||
sources={f"comp_{i}": i + 1 for i in range(0xFF)},
|
||||
sources={f"comp_{i}": i + 1 for i in range(0x1FF)},
|
||||
table_registered=True,
|
||||
)
|
||||
monkeypatch.setattr(ch, "CORE", Mock(data={ch._COMPONENT_SOURCE_DOMAIN: pool}))
|
||||
|
||||
Reference in New Issue
Block a user