Skip to content
Draft
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
66 changes: 66 additions & 0 deletions .github/workflows/gh-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main
paths:
- .github/workflows/gh-pages.yaml
release:
types:
- published
- unpublished

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.2.2

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install requests
run: |
python -m pip install --upgrade pip
pip install requests

- name: Fetch releases and update HTML
run: |
python tools/generate_web_flasher_webpage.py

- name: Upload artifact
uses: actions/upload-pages-artifact@v3.0.1
with:
path: static
retention-days: 1

deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
steps:
- name: Setup Pages
uses: actions/configure-pages@v5.0.0
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4.0.5
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ artifact/
artifacts/
trashed_modified_files/
src/**/*.bak
misc/**/*.bak
misc/**/*.bak
static/assets/*
89 changes: 89 additions & 0 deletions static/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<!doctype html>
<html>
<head>
<title>Manual Home Assistant Connect ZBT-1 Firmware Upgrade</title>
<meta name="description" content="Manually upgrade firmware for the Home Assistant Connect ZBT-1." />
<meta name="robots" content="noindex" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap" rel="stylesheet">

<style>
body {
background-color: rgb(248, 253, 255);
font-family: "Figtree", serif;
font-optical-sizing: auto;
font-size: 16px;
font-weight: 400;
-webkit-font-smoothing: antialiased;
margin: 0;
}

h1 {
font-weight: 600;
}

header {
border-top: 74px solid #174B62;
}

blockquote {
border-left: 1px solid #ddd;
color: #7C7F80;
font-style: italic;
padding: 0 15px;
}

section {
max-width: 1400px;
margin-left: auto;
margin-right: auto;
padding: 16px;
line-height: 24px;
box-sizing: border-box;
}

nabucasa-zigbee-flasher {
font-family: "Figtree", serif;

--mdc-theme-primary: #00AEF8;
--mdc-theme-on-primary: #FFFFFF;

--mdc-typography-button-font-family: "Figtree", serif;
--mdc-typography-button-font-weight: 600;
--mdc-typography-button-font-size: 16px;
--mdc-typography-button-letter-spacing: 0;
--mdc-typography-button-text-transform: none;

--mdc-shape-small: 2rem;

--mdc-button-raised-box-shadow: none;
--mdc-button-height: 40px;
--mdc-button-horizontal-padding: 18px;

}
</style>
</head>

<body>
<header></header>
<section>
<h1>Manual Connect ZBT-1 Firmware Upgrade</h1>
<blockquote>
<strong>Notice:</strong>

All devices can now be updated straight from Home Assistant as of 2025.4.0.

Manual firmware installation through the web flasher is not recommended for Home Assistant SkyConnect and Home Assistant Connect&nbsp;ZBT-1 devices purchased before October 20, 2024.
</blockquote>
<p>
To manually update your Home Assistant Connect&nbsp;ZBT-1 firmware, plug the stick to your current computer and click on the <strong>Connect</strong> button below.
</p>
<nabucasa-zigbee-flasher manifest="./assets/zbt1.json">
<span slot="button">Connect</span>
</nabucasa-zigbee-flasher>
</section>

<script type="module" src="https://unpkg.com/@nabucasa/sl-web-tools@0.11.0/dist/web/nabucasa-zigbee-flasher.js?module"></script>
</body>
</html>
93 changes: 93 additions & 0 deletions tools/generate_web_flasher_webpage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import os
import json
import time
import pathlib
import requests

REPO = os.getenv("GITHUB_REPOSITORY", "NabuCasa/silabs-firmware-builder")
API_URL = f"https://api.github.com/repos/{REPO}/releases/latest"
ASSETS_ROOT = pathlib.Path(__file__).parent.parent / "static/assets"


def download_release():
rsp = requests.get(API_URL)
rsp.raise_for_status()

for asset in rsp.json()["assets"]:
url = asset["browser_download_url"]
name = asset["name"]

asset_rsp = requests.get(url)
asset_rsp.raise_for_status()

(ASSETS_ROOT / name).write_bytes(asset_rsp.content)


def main():
ASSETS_ROOT.mkdir(parents=True, exist_ok=True)

for attempt in range(5):
download_release()

if (ASSETS_ROOT / "manifest.json").exists():
break

time.sleep(30)
else:
raise RuntimeError("Manifest was never uploaded, cannot release")

manifest = json.loads((ASSETS_ROOT / "manifest.json").read_text())["firmwares"]

zbt1_firmwares = {
fw["metadata"]["fw_type"]: fw
for fw in manifest
if fw["filename"].startswith(("skyconnect_", "zbt1_"))
}

(ASSETS_ROOT / "zbt1.json").write_text(
json.dumps(
{
"product_name": "Home Assistant ZBT-1",
"baudrates": {
"bootloader": [115200],
"ezsp": [115200],
"spinel": [460800],
"cpc": [460800, 115200, 230400],
"router": [115200],
},
"usb_filters": [{"pid": 60000, "vid": 4292}],
"firmwares": [
{
"name": "Zigbee (EZSP)",
"url": "assets/" + zbt1_firmwares["zigbee_ncp"]["filename"],
"type": "ncp-uart-hw",
"version": zbt1_firmwares["zigbee_ncp"]["metadata"][
"ezsp_version"
],
},
{
"name": "OpenThread (RCP)",
"url": "assets/" + zbt1_firmwares["openthread_rcp"]["filename"],
"type": "ot-rcp",
"version": (
zbt1_firmwares["openthread_rcp"]["metadata"][
"ot_rcp_version"
]
.split("/")[-1]
.split("_")[0]
),
},
{
"name": "Multiprotocol (deprecated)",
"url": "https://raw.githubusercontent.com/NabuCasa/silabs-firmware/main/RCPMultiPAN/beta/NabuCasa_SkyConnect_RCP_v4.3.2_rcp-uart-hw-802154_460800.gbl",
"type": "rcp-uart-802154",
"version": "4.3.2",
},
],
"allow_custom_firmware_upload": True,
}
)
)


main()
Loading