Commit Graph

28032 Commits

Author SHA1 Message Date
J. Nick Koston 31e97e0161 Merge remote-tracking branch 'origin/libretiny-bk7238-boards' into integration 2026-04-26 07:12:14 -05:00
J. Nick Koston 1a0642546b [bk72xx] Add BK7238 boards in preparation for upstream support 2026-04-26 06:47:51 -05:00
J. Nick Koston 2e6f623163 Merge remote-tracking branch 'upstream/dev' into integration 2026-04-26 06:32:47 -05:00
Darafei Praliaskouski b084fa4490 [esp32] Make ESP-IDF builds reproducible (#16008)
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-04-26 06:31:32 -05:00
J. Nick Koston e30c60c277 Merge branch 'codex/pr15983-idf-reproducible' into integration 2026-04-26 06:24:16 -05:00
J. Nick Koston 8096b95910 Merge remote-tracking branch 'upstream/skip_external_files_update_logs' into integration 2026-04-26 04:51:47 -05:00
J. Nick Koston 3438ff817a Address review: drop redundant comments and rely on existing CORE.reset() between tests 2026-04-26 04:49:04 -05:00
J. Nick Koston 4654f427ca Merge remote-tracking branch 'upstream/skip_external_files_update_logs' into integration 2026-04-26 04:44:42 -05:00
J. Nick Koston 5150a32224 [external_files] Unify skip_external_update via CORE flag for git as well 2026-04-26 04:43:53 -05:00
J. Nick Koston 26ba4850e4 [external_files] Skip remote freshness checks during esphome logs
Avoid per-file HTTP HEAD requests during config validation when running
esphome logs against a previously-cached project. The skip_external_update
flag was already plumbed for git operations, but external_files.download_content
ignored it. Thread it through CORE so audio_file, micro_wake_word,
speaker/media_player, image, font, and bme68x_bsec2 reuse cached files
without per-URL network round-trips when the file already exists locally.
2026-04-26 04:37:35 -05:00
J. Nick Koston 096721f1d5 Merge remote-tracking branch 'upstream/templatable-int-fix' into integration 2026-04-26 04:25:17 -05:00
J. Nick Koston bd1dd68d6b [rotary_encoder][at581x] Fix templatable int field types
The TEMPLATABLE_VALUE C++ fields are typed `int`, but Python codegen
was passing `cg.int32` (`int32_t`). On ESP-IDF/xtensa toolchains where
`int32_t` is `long`, the codegen-generated lambda's function-pointer
type `int32_t (*)(...)` does not match `int (*)(...)`, causing
`TemplatableFn` to select its deprecated casting-trampoline overload
and emit a `-Wdeprecated-declarations` warning at every call site.

Use `cg.int_` so the lambda's return type matches the field exactly.
2026-04-26 04:24:59 -05:00
J. Nick Koston a8d767cc5c Merge remote-tracking branch 'upstream/dev' into integration 2026-04-26 04:16:55 -05:00
J. Nick Koston 9028cc8c3e Merge remote-tracking branch 'origin/git_shallow_fetch' into integration 2026-04-26 04:13:13 -05:00
Darafei Praliaskouski 68625a1b76 [core] Isolate generated build metadata (#16007)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-04-26 09:11:09 +00:00
J. Nick Koston e907e71101 [git] Address PR review feedback
- Add `--` terminator before submodule paths (both clone and refresh
  paths) so a path beginning with `-` cannot be parsed as a git option.
- Reword the refresh-fetch comment: this fetch also runs when ref is
  None, in which case it pulls the remote default branch.
2026-04-26 04:08:43 -05:00
J. Nick Koston 301a855e36 Merge branch 'dev' into codex/pr15983-idf-reproducible 2026-04-26 04:01:08 -05:00
J. Nick Koston b3a57d1395 [git] Make ref fetches and submodule updates shallow
Fixes esphome/esphome#11550

When clone_or_update is called with a ref or submodules, the initial
clone uses --depth=1 but the subsequent git fetch and git submodule
update commands run deep, pulling the full history on every refresh.
This causes excess network traffic and disk usage for external_components,
packages, and dashboard imports.

Add --depth=1 to all four call sites (initial fetch, initial submodule
init, refresh fetch, refresh submodule update). Shallow fetches still
advance the local clone to the current remote tip when it moves, so the
refresh path keeps working as before.
2026-04-26 03:57:35 -05:00
Darafei Praliaskouski 8ae4b3a771 test: fix reproducible build docstring style 2026-04-26 12:47:59 +04:00
J. Nick Koston dc57969afd [host] Use integer math in millis()/micros() (#15994) 2026-04-26 08:39:24 +00:00
Darafei Praliaskouski 5be9766809 perf(build): enable reproducible PlatformIO ESP-IDF builds 2026-04-26 10:56:39 +04:00
J. Nick Koston f092e619d8 [rtttl] Gate on_finished_playback callback storage behind define (#16003) 2026-04-26 00:03:59 -05:00
J. Nick Koston 58f6ad2d0c [safe_mode] Use StaticCallbackManager for on_safe_mode (#16002) 2026-04-26 00:01:21 -05:00
Keith Burzinski bc33260c61 [ir_rf_proxy] Extend for RF (#15744)
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-04-25 22:33:02 -05:00
J. Nick Koston 4cab262ef8 [ci] Trigger CodSpeed benchmarks on host platform changes (#15995) 2026-04-25 17:18:21 -04:00
J. Nick Koston b1f7a39252 Merge remote-tracking branch 'origin/dev' into integration 2026-04-25 16:02:21 -05:00
dependabot[bot] 9ad820c921 Bump esphome-dashboard from 20260408.1 to 20260425.0 (#16006)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-25 20:59:01 +00:00
J. Nick Koston 4f8feb86f0 [dashboard] Add --no-states support to logs WebSocket handler (#15993) 2026-04-25 15:43:05 -05:00
J. Nick Koston 7702f8a6e7 Merge branch 'bh1750-illuminance-logv' into integration 2026-04-25 15:26:28 -05:00
J. Nick Koston d2baa0437a m 2026-04-25 15:26:26 -05:00
J. Nick Koston 827163d502 [bh1750] Downgrade per-reading Illuminance log to verbose
The base sensor already logs the published state via the [S]
publish line, so the component-level [D] line was redundant
log spam on every update. Drop it to ESP_LOGV.
2026-04-25 15:25:41 -05:00
J. Nick Koston 00cad4333e Merge branch 'safe-mode-static-callback-manager' into integration 2026-04-25 14:47:41 -05:00
J. Nick Koston ea0a6df1fb Merge remote-tracking branch 'upstream-ssh/rtttl-gate-callback-manager' into integration 2026-04-25 14:47:36 -05:00
J. Nick Koston 12f744bbbe [rtttl] Gate on_finished_playback callback storage behind define
Wrap the on_finished_playback CallbackManager storage, registration
method and call site behind USE_RTTTL_FINISHED_PLAYBACK_CALLBACK so
configs without an on_finished_playback automation pay zero RAM and
zero flash for it.

Keeps CallbackManager rather than switching to StaticCallbackManager
because rtttl is MULTI_CONF — a per-class compile-time N would force
every instance to reserve max(callbacks_per_instance) slots.
2026-04-25 14:26:23 -05:00
J. Nick Koston d7a69979e7 [safe_mode] Use StaticCallbackManager for on_safe_mode
safe_mode is a single-instance component, so a compile-time-sized
StaticVector backing for the callback list is a clean fit. Drop the
std::vector reallocation machinery (_M_realloc_insert) and size the
storage to the exact number of on_safe_mode automations via
ESPHOME_SAFE_MODE_CALLBACK_COUNT.
2026-04-25 14:23:31 -05:00
J. Nick Koston 9dfad8ba86 Merge remote-tracking branch 'upstream-ssh/bluetooth-proxy-redundant-bda-write' into integration 2026-04-25 13:54:14 -05:00
J. Nick Koston a2a9145a87 [bluetooth_proxy] Drop redundant remote_bda_ write in connect handler
get_connection_(msg.address, true) already populates remote_bda_ via
set_address(): either the slot was found because get_address() == msg.address
(so address_ and remote_bda_ already encode it), or a free slot was reserved
and set_address(msg.address) was called, which writes remote_bda_[0..5] from
the same bytes. The follow-up uint64_to_bd_addr(msg.address, connection->remote_bda_)
just rewrites the identical bytes.
2026-04-25 13:47:52 -05:00
J. Nick Koston be849f0a1a merge 2026-04-25 13:25:04 -05:00
J. Nick Koston 1e5a753e0e Merge branch 'output-power-scaling-optional' into integration 2026-04-25 13:10:27 -05:00
J. Nick Koston 4432516614 [output] Address Copilot review + add static_assert stubs for documented lambda API
- Replace inverted comments in set_min_power/set_max_power clamp lines
  (MIN>=MAX>=1.0 → min_power <= max <= 1.0) — pre-existing bug.
- Update FloatOutput class docstring to describe the conditional scaling
  behavior under USE_OUTPUT_FLOAT_POWER_SCALING.
- Reword the zero_means_zero codegen comment to explain why we gate on
  the value (schema default=False would otherwise force the define on).
- Add templated static_assert stubs for set_min_power/set_max_power/
  set_zero_means_zero in the #else branch so calls from lambdas
  (documented at esphome.io/components/output/#output-set_min_power_action)
  produce a clear compile error pointing at the user's lambda site, with
  the migration instruction inline (add 'min_power: 0%' / 'max_power: 100%'
  / 'zero_means_zero: true' to one output entry to enable scaling).

Templating on a default-false bool means the assert only fires on
instantiation (i.e. when the user actually calls the method), not on
every parse — so unused stubs in TUs that include the header (e.g.
output/automation.cpp when scaling actions aren't registered) don't
break the build.

Verified: a lambda calling id(out).set_min_power(0.2) without min_power
in YAML now fails compilation with a pointer at the lambda line and the
inline migration message; adding min_power: 0% to the output entry makes
the same config build clean.
2026-04-25 13:07:12 -05:00
J. Nick Koston f797090f1d Merge remote-tracking branch 'origin/output-power-scaling-optional' into integration 2026-04-25 12:42:52 -05:00
J. Nick Koston 15cb2c0580 [output] Gate FloatOutput power scaling fields behind USE_OUTPUT_FLOAT_POWER_SCALING
The min_power / max_power / zero_means_zero scaling support on FloatOutput
costs 12 bytes per instance (max_power_, min_power_, zero_means_zero_ +
alignment padding) on every PWM channel, DAC channel, LEDC output, and
dimmer-chip channel — even on configs that never touch the feature.

Repo-wide usage is ~17 YAML lines, mostly in test fixtures and a couple
of LED-driver chip tests; the runtime set_min_power / set_max_power
actions added in #8934 have no usage outside the action's own test.

Add USE_OUTPUT_FLOAT_POWER_SCALING and gate the fields and scaling math
in FloatOutput::set_level() behind it, mirroring the USE_POWER_SUPPLY
pattern already used in BinaryOutput. Python codegen flips the define on
whenever:
- a min_power / max_power / zero_means_zero key is set on any output, or
- a non-default zero_means_zero value is provided, or
- an output.set_min_power / output.set_max_power action is registered

The action class templates (SetMinPowerAction, SetMaxPowerAction) are
also gated on the same define so their non-dependent member access on
FloatOutput::set_min_power doesn't fail to parse when the methods aren't
compiled in. zero_means_zero_ now has a default initializer (was UB
before — it was always written from setup, but only because the schema
default forced it).

For configs without scaling: 12 B .bss saved per FloatOutput instance,
plus a small flash saving from the elided multiply/subtract in
set_level(). For configs with scaling: behavior is unchanged.

Verified on tests/components/esp8266_pwm (no scaling): pstorage 0x28 → 0x1c
per output (40 B → 28 B). Verified on tests/components/output (uses
set_min_power/set_max_power actions): builds correctly with the define on.
2026-04-25 12:39:32 -05:00
Javier Peletier b5ccd55f4e [packages] Fix premature substitution of vars in remote package files (#15997)
Co-authored-by: J. Nick Koston <nick+github@koston.org>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-25 17:06:58 +00:00
J. Nick Koston 4f51057fc2 [api] Clarify fence comment per review
Plain non-atomic load on the fast path is not a 'relaxed load' in the
C++ atomic sense; describe what the fence accomplishes instead.
2026-04-25 11:00:18 -05:00
J. Nick Koston df86f3aa0d Merge remote-tracking branch 'upstream-ssh/api-idle-once-per-loop-fence' into integration 2026-04-25 10:54:50 -05:00
J. Nick Koston f9ad090bf9 [api] Hoist memw out of socket ready check to once per main-loop iter
On Xtensa under default -mserialize-volatile, GCC emits a memw before
every volatile load. esphome_lwip_socket_has_data() is called once per
socket per main-loop iteration (one for the listening socket in
APIServer::loop and one per connected client in APIConnection::loop),
making per-call memw a measurable cost on the idle path.

Replace the per-call memw with a single std::atomic_thread_fence
(memory_order_acquire) at the top of Application::loop. The fence pairs
with the TCP/IP thread's existing SYS_ARCH_UNPROTECT release on
rcvevent. The wake path (xTaskNotifyGive in the lwip event_callback
hook, ulTaskNotifyTake at the bottom of the loop) is independent of
rcvevent visibility and is non-losing, so writes that land between the
fence and sleep are picked up by the next iteration.

Gated on ESPHOME_THREAD_MULTI_ATOMICS so that BK72xx (which lacks
LDREX/STREX and is built without libatomic) keeps the original volatile
load path. ESP32, RTL87xx and LN882x get the optimization; ESP8266,
RP2040 and host use the socket_ready_fd fallback and are unaffected.

Disassembly (ESP32, gatetrigger): APIServer::loop -8 B, APIConnection
::loop -5 B; loop_task gains one memw for the fence. Net per idle
iteration with N clients: save N memw on ready paths, add 1 for the
fence (savings scale with client count and other Socket::ready callers
like AsyncClient and CaptivePortal DNS).
2026-04-25 10:47:41 -05:00
J. Nick Koston 2a02136752 Merge remote-tracking branch 'upstream/dashboard-logs-no-states' into integration 2026-04-25 08:49:04 -05:00
J. Nick Koston 1b059f7fb2 Log post-append cmd in EsphomeLogsHandler so debug shows --no-states 2026-04-25 08:07:55 -05:00
J. Nick Koston 1574cf6256 [dashboard] Add --no-states support to logs WebSocket handler
EsphomeLogsHandler.build_command now appends --no-states to the
spawned `esphome logs` argv when the WebSocket spawn message
includes `no_states: true`. This lets the dashboard frontend
suppress entity-state log lines for OTA log sessions without
requiring users to drop to the CLI.

Adds three unit tests covering the truthy, missing, and explicit-False
cases.
2026-04-25 07:52:50 -05:00
J. Nick Koston c73311bf8b Merge remote-tracking branch 'upstream/bluetooth_proxy_revert_set_interval' into int_rev 2026-04-25 05:18:30 -05:00