Skip to content

Add song 6, Improv over BLE, and the certification fixes - #14

Merged
Bunton33 merged 1 commit into
mainfrom
add-ble-improv
Aug 25, 2026
Merged

Bunton33 merged 1 commit into
mainfrom
add-ble-improv

Conversation

@Bunton33

Copy link
Copy Markdown
Contributor

Bumps the version to 26.8.25.1 so the update entity offers this to units in the field - the shared build workflow reads that substitution out of Core.yaml as the release tag.

Song 6: "Do You Want To Build A Snowman"

Double-press or hold on Song Button 2 (GPIO5) plays the Frozen chorus hook. Song 1 is already called "Snowman" but is Frosty the Snowman, a different tune, so this one is named BuildASnowman to keep the two apart in the rtttl logs. 105 chars, 34 notes, 11.9s, well inside the ~254 byte NVS preference.

Button 2 moves from a plain on_release to the same on_multi_click set buttons 1 and 3 use, and the deep-sleep wake decoder gets the matching hold-confirm path. A double-press cannot survive deep sleep - boot from the ext1 wake outlasts the two clicks and ext1 gives a latched pin mask with no click count

  • so the hold is what makes the gesture work asleep, exactly as on the other two buttons. Button 2 gives up its zero-latency wake path for this.

Also adds a Snowfall LED effect so song 6 has its own look, clock-driven rather than positional for the same reason PinkParty is.

Improv over BLE

esp32_improv was the one hard Made for ESPHome requirement the config was missing. It costs +432 B RAM and +21 KB flash here because esp32_ble is already linked in for the Bluetooth proxy, and it stops itself once wifi connects, so a provisioned unit never advertises.

Certification and entity quality

  • api: bare encryption: with no key, so Noise support is compiled in without putting a secret in a public config. An adopting client supplies the key.
  • ids on the singleton components (api, logger, web_server, captive_portal, improv_serial, safe_mode, http_request, bluetooth_proxy) so adopters can !extend and !remove them.
  • esp32_ble_tracker scan_parameters continuous: false. The tracker starts a scan in its own setup(), before the on_boot -300 handler reads the proxy switch, so a fresh unit scanned briefly with the switch off - in the same window Improv needs to advertise.
  • Restart, Restart (Safe Mode) and Factory Reset buttons. Factory reset was internal: true, so a 10s button hold was the only way to clear a unit.
  • wifi_info and version diagnostics, all disabled_by_default.
  • entity_category on Song Button 1/2/3, Wake-up Button Pressed, OTA Mode and Volume; they were landing on users' dashboards.
  • The template button was renamed to "Reinstall Firmware" - the update entity already had the name "Firmware Update".
  • api services: -> actions:, and device_class: firmware on the update entity.

Bug fixes found along the way

  • A malformed RTTTL string left all 37 LEDs on at 80% forever. The play scripts light up before rtttl.play, which returns early on a parse error without ever reaching RUNNING, so on_finished_playback never fired. Song Text is user-editable, so one typo stranded the ornament lit.
  • Sleep Duration min_value was 0, but the on_value lambda refuses 0, so setting it left the entity reading "0 h" while the device kept sleeping for its previous duration.
  • swallow_clear and sleep_grace_period defaulted to mode: single, which discards a re-arm instead of restarting the window.
  • A stray ';' on songs 2 and 3 parsed as a rest, appending a silent quarter note to each.

Verified with a clean build on esphome 2026.7.3: H-3 at RAM 47.3% / flash 51.0%, H-3D at RAM 18.6% / flash 8.5%.

Version:

What does this implement/fix?

Types of changes

  • Bugfix (fixed change that fixes an issue)
  • New feature (thanks!)
  • Breaking change (repair/feature that breaks existing functionality)
  • Dependency Update - Does not publish
  • Other - Does not publish
  • Website of github readme file update - Does not publish
  • Github workflows - Does not publish

Checklist / Checklijst:

  • The code change has been tested and works locally
  • The code change has not yet been tested

If user-visible functionality or configuration variables are added/modified:

  • Added/updated documentation for the web page

Bumps the version to 26.8.25.1 so the update entity offers this to units in
the field - the shared build workflow reads that substitution out of
Core.yaml as the release tag.

Song 6: "Do You Want To Build A Snowman"

Double-press or hold on Song Button 2 (GPIO5) plays the Frozen chorus hook.
Song 1 is already called "Snowman" but is Frosty the Snowman, a different
tune, so this one is named BuildASnowman to keep the two apart in the rtttl
logs. 105 chars, 34 notes, 11.9s, well inside the ~254 byte NVS preference.

Button 2 moves from a plain on_release to the same on_multi_click set buttons
1 and 3 use, and the deep-sleep wake decoder gets the matching hold-confirm
path. A double-press cannot survive deep sleep - boot from the ext1 wake
outlasts the two clicks and ext1 gives a latched pin mask with no click count
- so the hold is what makes the gesture work asleep, exactly as on the other
two buttons. Button 2 gives up its zero-latency wake path for this.

Also adds a Snowfall LED effect so song 6 has its own look, clock-driven
rather than positional for the same reason PinkParty is.

Improv over BLE

esp32_improv was the one hard Made for ESPHome requirement the config was
missing. It costs +432 B RAM and +21 KB flash here because esp32_ble is
already linked in for the Bluetooth proxy, and it stops itself once wifi
connects, so a provisioned unit never advertises.

Certification and entity quality

- api: bare encryption: with no key, so Noise support is compiled in without
  putting a secret in a public config. An adopting client supplies the key.
- ids on the singleton components (api, logger, web_server, captive_portal,
  improv_serial, safe_mode, http_request, bluetooth_proxy) so adopters can
  !extend and !remove them.
- esp32_ble_tracker scan_parameters continuous: false. The tracker starts a
  scan in its own setup(), before the on_boot -300 handler reads the proxy
  switch, so a fresh unit scanned briefly with the switch off - in the same
  window Improv needs to advertise.
- Restart, Restart (Safe Mode) and Factory Reset buttons. Factory reset was
  internal: true, so a 10s button hold was the only way to clear a unit.
- wifi_info and version diagnostics, all disabled_by_default.
- entity_category on Song Button 1/2/3, Wake-up Button Pressed, OTA Mode and
  Volume; they were landing on users' dashboards.
- The template button was renamed to "Reinstall Firmware" - the update entity
  already had the name "Firmware Update".
- api services: -> actions:, and device_class: firmware on the update entity.

Bug fixes found along the way

- A malformed RTTTL string left all 37 LEDs on at 80% forever. The play
  scripts light up before rtttl.play, which returns early on a parse error
  without ever reaching RUNNING, so on_finished_playback never fired. Song
  Text is user-editable, so one typo stranded the ornament lit.
- Sleep Duration min_value was 0, but the on_value lambda refuses 0, so
  setting it left the entity reading "0 h" while the device kept sleeping for
  its previous duration.
- swallow_clear and sleep_grace_period defaulted to mode: single, which
  discards a re-arm instead of restarting the window.
- A stray ';' on songs 2 and 3 parsed as a rest, appending a silent quarter
  note to each.

Verified with a clean build on esphome 2026.7.3: H-3 at RAM 47.3% / flash
51.0%, H-3D at RAM 18.6% / flash 8.5%.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 23282997-8748-47e0-8de2-026fa7fbf44b


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the new-feature New feature or request label Aug 25, 2026
@github-actions
github-actions Bot requested a review from bharvey88 August 25, 2026 18:03
@Bunton33
Bunton33 merged commit 0abc95b into main Aug 25, 2026
10 checks passed
@bharvey88
bharvey88 deleted the add-ble-improv branch August 28, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants