Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
strategy:
matrix:
include:
- { yaml: Integrations/ESPHome/CAST-1_W.yaml, name: firmware-w }
- { yaml: Integrations/ESPHome/CAST-1_ETH.yaml, name: firmware-e }
- { yaml: Integrations/ESPHome/beta-channel/CAST-1_W.yaml, name: firmware-w }
- { yaml: Integrations/ESPHome/beta-channel/CAST-1_ETH.yaml, name: firmware-e }
uses: esphome/workflows/.github/workflows/build.yml@025a1e6255610c498ed590403b7e510b69e474df # 2026.4.1
with:
files: ${{ matrix.yaml }}
Expand Down
8 changes: 0 additions & 8 deletions Integrations/ESPHome/CAST-1_ETH.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ ota:
- platform: http_request
id: ota_managed

http_request:
verify_ssl: true
# Beta OTA manifests/binaries are GitHub release assets, which 302-redirect to
# long signed CDN URLs (~900+ bytes). The default 512-byte RX buffer overflows
# ("Out of buffer"), so enlarge it. See esphome/esphome#13786.
buffer_size_rx: 4096
buffer_size_tx: 1024

safe_mode:

update:
Expand Down
8 changes: 0 additions & 8 deletions Integrations/ESPHome/CAST-1_W.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ ota:
- platform: http_request
id: ota_managed

http_request:
verify_ssl: true
# Beta OTA manifests/binaries are GitHub release assets, which 302-redirect to
# long signed CDN URLs (~900+ bytes). The default 512-byte RX buffer overflows
# ("Out of buffer"), so enlarge it. See esphome/esphome#13786.
buffer_size_rx: 4096
buffer_size_tx: 1024

safe_mode:

improv_serial:
Expand Down
90 changes: 80 additions & 10 deletions Integrations/ESPHome/Core.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,40 @@
substitutions:
version: "26.7.8.1"
version: "26.7.12.1"
# Default update channel on first boot (no stored user choice yet, i.e. a
# fresh flash). The beta-channel builds override this to "Beta" (see
# Integrations/ESPHome/beta-channel/) so firmware obtained from the beta
# channel keeps tracking it instead of offering a stable "downgrade".
firmware_channel_default: "Stable"
# Manifest URL bases. Stable = GitHub Pages (main branch builds).
# Beta = rolling "beta-fw" pre-release assets (beta branch builds).
stable_manifest_base: "https://apolloautomation.github.io/CAST-1"
beta_manifest_base: "https://github.com/ApolloAutomation/CAST-1/releases/download/beta-fw"


packages:
wizmote: !include wizmote.yaml

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).
on_boot:
# Point the update entity at the selected type/channel manifest.
- priority: -100
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).
- priority: -300
then:
- if:
condition:
switch.is_on: bluetooth_proxy_switch
then:
- esp32_ble_tracker.start_scan:
continuous: true
else:
- esp32_ble_tracker.stop_scan:

esp32:
variant: ESP32S3
flash_size: 8MB
Expand All @@ -26,6 +56,15 @@ esp32:
CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC: "y"
CONFIG_MBEDTLS_SSL_PROTO_TLS1_3: "y"

# BT allocations go to PSRAM first (CONFIG_BT_* options above), keeping
# internal RAM free for the audio pipelines.
esp32_ble_tracker:
id: ble_tracker
scan_parameters:
continuous: true

bluetooth_proxy:

api:

globals:
Expand Down Expand Up @@ -67,6 +106,17 @@ web_server:
port: 80
version: 3

http_request:
verify_ssl: true
# GitHub release-asset downloads answer with a redirect carrying a
# ~3.6 KB Content-Security-Policy header; each header line must fit
# this buffer or the request fails with "HTTP_CLIENT: Out of buffer".
buffer_size_rx: 5120
# The redirect target is a signed URL with a ~850-char query string; the
# follow-up request line must fit the TX buffer or esp_http_client_open
# fails with "Out of buffer" before sending anything.
buffer_size_tx: 2048

i2c:
sda: GPIO47
scl: GPIO48
Expand All @@ -79,11 +129,17 @@ button:
- platform: template
name: "Firmware Update"
id: update_firmware
icon: mdi:cloud-download
entity_category: config
on_press:
then:
- lambda: |-
id(update_http_request).perform(true);
- logger.log: "Applying firmware update for the selected type and channel"
- delay: 3s
- script.execute: apply_ota_source
- script.wait: apply_ota_source
# The manifest fetch runs in its own task; give it a fixed window to land
# (update.is_available stays false for same-version switches).
- delay: 5s
- lambda: id(update_http_request).perform(true);

binary_sensor:
- platform: status
Expand Down Expand Up @@ -139,6 +195,19 @@ switch:
id: enable_dac
restore_mode: ALWAYS_ON

- platform: template
name: "Bluetooth Proxy"
id: bluetooth_proxy_switch
icon: mdi:bluetooth
entity_category: "config"
restore_mode: RESTORE_DEFAULT_OFF
optimistic: true
on_turn_on:
- esp32_ble_tracker.start_scan:
continuous: true
on_turn_off:
- esp32_ble_tracker.stop_scan:

text_sensor:
- platform: sendspin
type: title
Expand Down Expand Up @@ -210,7 +279,7 @@ select:
options:
- "Stable"
- "Beta"
initial_option: "Stable"
initial_option: "${firmware_channel_default}"
on_value:
then:
- script.execute: apply_ota_source
Expand Down Expand Up @@ -377,21 +446,22 @@ script:
- id: apply_ota_source
# Sets the OTA source URL from the two selectors: Firmware Type (WiFi/Ethernet)
# x Firmware Channel (Stable/Beta). Stable = GitHub Pages (main branch builds),
# Beta = GitHub release assets.
# Beta = rolling "beta-fw" release assets.
then:
- lambda: |-
const bool eth = id(firmware_selector).current_option() == "Ethernet";
const bool beta = id(firmware_channel).current_option() == "Beta";
std::string url;
if (beta) {
url = eth
? "https://github.com/ApolloAutomation/CAST-1/releases/download/beta-fw/manifest-e.json"
: "https://github.com/ApolloAutomation/CAST-1/releases/download/beta-fw/manifest-w.json";
? "${beta_manifest_base}/manifest-e.json"
: "${beta_manifest_base}/manifest-w.json";
} else {
url = eth
? "https://apolloautomation.github.io/CAST-1/firmware-e/manifest.json"
: "https://apolloautomation.github.io/CAST-1/firmware-w/manifest.json";
? "${stable_manifest_base}/firmware-e/manifest.json"
: "${stable_manifest_base}/firmware-w/manifest.json";
}
ESP_LOGI("firmware", "OTA manifest set to: %s", url.c_str());
id(update_http_request).set_source_url(url);
- component.update: update_http_request
- id: statusCheck
Expand Down
9 changes: 9 additions & 0 deletions Integrations/ESPHome/beta-channel/CAST-1_ETH.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Beta-channel build of CAST-1_ETH.yaml: the identical image except the Firmware
# Channel select defaults to "Beta" on first boot, so firmware obtained from
# the beta channel keeps tracking it. Built by build-beta.yml only; the
# stable (GitHub Pages) builds use CAST-1_ETH.yaml directly.
substitutions:
firmware_channel_default: "Beta"

packages:
base: !include ../CAST-1_ETH.yaml
9 changes: 9 additions & 0 deletions Integrations/ESPHome/beta-channel/CAST-1_W.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Beta-channel build of CAST-1_W.yaml: the identical image except the Firmware
# Channel select defaults to "Beta" on first boot, so firmware obtained from
# the beta channel keeps tracking it. Built by build-beta.yml only; the
# stable (GitHub Pages) builds use CAST-1_W.yaml directly.
substitutions:
firmware_channel_default: "Beta"

packages:
base: !include ../CAST-1_W.yaml