From e0dbeb6cc1b2864fcf828eb07f5aa34e71c3e7c4 Mon Sep 17 00:00:00 2001 From: Brandon Harvey <8107750+bharvey88@users.noreply.github.com> Date: Tue, 28 Jul 2026 19:44:52 -0500 Subject: [PATCH] Keep Bluetooth Proxy on for legacy BLE builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Bluetooth Proxy switch does restore from flash, but the _OFF half of RESTORE_DEFAULT_OFF decides the boot where nothing is stored yet, which is the first boot after the switch shipped. AIR-1_BLE.yaml inherited that mode from Core, so legacy BLE devices that had always proxied came up with the proxy off after updating. Core now reads the mode from a bluetooth_proxy_restore_mode substitution defaulting to RESTORE_DEFAULT_OFF, and AIR-1_BLE.yaml overrides it to RESTORE_DEFAULT_ON, the same override pattern the file already uses for its OTA manifest URLs. The unified image is unchanged and a user's saved choice still wins on every later boot. Refs ApolloAutomation/MSR-2#92 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- Integrations/ESPHome/AIR-1_BLE.yaml | 4 ++++ Integrations/ESPHome/Core.yaml | 12 +++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Integrations/ESPHome/AIR-1_BLE.yaml b/Integrations/ESPHome/AIR-1_BLE.yaml index 251a837..962187d 100644 --- a/Integrations/ESPHome/AIR-1_BLE.yaml +++ b/Integrations/ESPHome/AIR-1_BLE.yaml @@ -3,6 +3,10 @@ substitutions: ota_stable_manifest: "https://apolloautomation.github.io/AIR-1/firmware-ble/manifest.json" ota_beta_manifest: "https://github.com/ApolloAutomation/AIR-1/releases/download/beta-fw/manifest-ble.json" + # Legacy BLE devices proxied unconditionally before the Bluetooth Proxy + # switch existed, so default it on rather than dropping the proxy on update. + bluetooth_proxy_restore_mode: RESTORE_DEFAULT_ON + esphome: name: "${name}" friendly_name: Apollo AIR-1 diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 1c2f8e8..678519b 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -1,6 +1,6 @@ substitutions: name: apollo-air-1 - version: "26.7.23.1" + version: "26.7.29.1" device_description: ${name} made by Apollo Automation - version ${version}. # Default OTA password. Override in your device YAML by re-declaring # `substitutions: { ota_password: !secret _ota_password }` so each @@ -21,6 +21,12 @@ substitutions: ota_stable_manifest: "${stable_manifest_base}/firmware/manifest.json" ota_beta_manifest: "${beta_manifest_base}/manifest-standard.json" + # Bluetooth Proxy switch state on a device with no stored preference yet + # (first boot after this switch was added, or after a factory reset). The + # unified image ships the proxy off; AIR-1_BLE.yaml overrides this to ON so + # legacy BLE devices keep proxying instead of going quiet after an update. + bluetooth_proxy_restore_mode: RESTORE_DEFAULT_OFF + esphome: # List form so package merging concatenates with each variant's own on_boot # entries (mapping form would be replaced by the variant's block instead). @@ -29,7 +35,7 @@ esphome: then: - script.execute: apply_ota_source # Re-apply the Bluetooth Proxy switch after all components set up, so BLE - # scanning matches the persisted switch (proxy stays off by default). + # scanning matches the switch state restored from flash. - priority: -300 then: - if: @@ -612,7 +618,7 @@ switch: id: bluetooth_proxy_switch icon: mdi:bluetooth entity_category: "config" - restore_mode: RESTORE_DEFAULT_OFF + restore_mode: ${bluetooth_proxy_restore_mode} optimistic: true on_turn_on: - esp32_ble_tracker.start_scan: