Skip to content

Commit 1531410

Browse files
committed
Add zbt-1 install firmwhare
1 parent 6f926b1 commit 1531410

File tree

11 files changed

+602
-7
lines changed

11 files changed

+602
-7
lines changed

home-assistant-connect-zwa-2/use-poe.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
<div class="installer-card" id="installer">
8181
<install-esp-bridge-firmware
8282
manifest="https://firmware.esphome.io/ha-connect-zwa-2/home-assistant-zwa-2-poe/manifest.json"
83+
device_name="Waveshare PoE"
84+
serialport_label="W4v3"
8385
></install-esp-bridge-firmware>
8486
</div>
8587
</div>

package-lock.json

Lines changed: 326 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
},
1515
"dependencies": {
1616
"@awesome.me/webawesome": "^3.0.0-beta.6",
17+
"@nabucasa/sl-web-tools": "^0.11.0",
1718
"eslint-plugin-import": "^2.32.0",
1819
"eslint-plugin-lit": "^2.1.1",
1920
"eslint-plugin-wc": "^3.0.1",
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"product_name": "Home Assistant SkyConnect",
3+
"baudrates": {
4+
"bootloader": [115200],
5+
"cpc": [460800, 115200, 230400],
6+
"ezsp": [115200],
7+
"spinel": [460800],
8+
"router": [115200]
9+
},
10+
"usb_filters": [
11+
{
12+
"pid": 60000,
13+
"vid": 4292
14+
}
15+
],
16+
"firmwares": [
17+
{
18+
"name": "Zigbee (EZSP)",
19+
"url": "https://raw.githubusercontent.com/NabuCasa/silabs-firmware/main/EmberZNet/beta/NabuCasa_SkyConnect_EZSP_v7.1.4.0_ncp-uart-hw_115200.gbl",
20+
"type": "zigbee_ncp",
21+
"version": "7.1.4.0"
22+
},
23+
{
24+
"name": "Zigbee Router",
25+
"url": "https://raw.githubusercontent.com/NabuCasa/silabs-firmware/main/EmberZNet/beta/NabuCasa_SkyConnect_EZSP_v7.1.4.0_router_115200.gbl",
26+
"type": "zigbee_router",
27+
"version": "7.1.4.0"
28+
},
29+
{
30+
"name": "Multi-PAN (RCP)",
31+
"url": "https://raw.githubusercontent.com/NabuCasa/silabs-firmware/main/RCPMultiPAN/NabuCasa_SkyConnect_RCP_v4.1.4_rcp-uart-hw-802154_115200.gbl",
32+
"type": "multipan",
33+
"version": "4.1.4"
34+
},
35+
{
36+
"name": "OpenThread",
37+
"url": "https://raw.githubusercontent.com/NabuCasa/silabs-firmware/main/OpenThreadRCP/NabuCasa_SkyConnect_OpenThread_RCP_v2.2.2.0_ot-rcp_hw_460800.gbl",
38+
"type": "openthread_rcp",
39+
"version": "2.2.2.0"
40+
}
41+
],
42+
"allow_custom_firmware_upload": true,
43+
"bootloader_gpio_reset": null
44+
}

src/pages/zbt1-details.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ export class ZBT1Details extends LitElement {
3737
</p>
3838
3939
<div slot="actions">
40+
<action-item
41+
href="/zbt1/install"
42+
icon="/svgs/install.svg"
43+
trailing-icon="/svgs/chevron-right.svg"
44+
>
45+
<h3>Install firmware</h3>
46+
<p>Update your ZBT-1 with the latest Zigbee or Thread firmware</p>
47+
</action-item>
4048
<action-item
4149
href="https://support.nabucasa.com/hc/en-us/categories/24734620813469"
4250
icon="/svgs/doc.svg"

src/pages/zbt1-install.ts

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
import '@nabucasa/sl-web-tools';
2+
import { LitElement, css, html } from 'lit';
3+
import { customElement } from 'lit/decorators.js';
4+
import '../components/details.js';
5+
6+
@customElement('zbt1-install')
7+
export class ZBT1InstallPage extends LitElement {
8+
static styles = css`
9+
:host {
10+
display: block;
11+
}
12+
13+
p[slot='subtitle'] {
14+
color: var(--wa-color-brand-50);
15+
font-size: 1.1rem;
16+
font-weight: 500;
17+
margin: 0 0 10px 0;
18+
}
19+
20+
.footer-content {
21+
margin-bottom: 16px;
22+
}
23+
24+
.footer-content h3 {
25+
margin-top: 24px;
26+
}
27+
28+
.footer-content ul,
29+
.footer-content ol {
30+
margin: 8px 0;
31+
padding-left: 24px;
32+
}
33+
34+
.footer-content li {
35+
margin: 8px 0;
36+
line-height: 1.6;
37+
}
38+
39+
.footer-content p {
40+
margin: 12px 0;
41+
line-height: 1.6;
42+
}
43+
44+
.footer-content a {
45+
color: var(--wa-color-brand-50);
46+
text-decoration: none;
47+
}
48+
49+
.footer-content a:hover {
50+
text-decoration: underline;
51+
}
52+
53+
.flasher-container {
54+
margin: 24px 0 12px 4px;
55+
}
56+
`;
57+
58+
render() {
59+
return html`
60+
<details-page back-href="/zbt1/" back-label="Back">
61+
<span slot="title">Install firmware</span>
62+
<p slot="subtitle">
63+
Update your ZBT-1 with the latest Zigbee or Thread firmware
64+
</p>
65+
66+
<div slot="footer" class="footer-content">
67+
<p>
68+
Home Assistant will automatically detect updates for the Home
69+
Assistant Connect ZBT-1 and allow you to install them. This page is
70+
only needed if you are using the device with other software than
71+
Home Assistant.
72+
</p>
73+
<p>
74+
<strong>Warning:</strong> Firmware update through web flasher is
75+
only available for Home Assistant SkyConnect devices and Home
76+
Assistant ZBT-1 devices purchased after October 20, 2024.
77+
</p>
78+
<p>
79+
This firmware installer supports installing both the latest version
80+
of the Zigbee and Thread firmware.
81+
</p>
82+
<div class="flasher-container">
83+
<nabucasa-zigbee-flasher
84+
manifest="/assets/manifests/skyconnect.json"
85+
>
86+
<span slot="button">Install firmware</span>
87+
</nabucasa-zigbee-flasher>
88+
</div>
89+
<h3>Update content of Voice PE firmware installer</h3>
90+
<p>
91+
Home Assistant will automatically detect updates for the Home
92+
Assistant Voice Preview Edition and allow you to install them. This
93+
page is only needed if you are using the device with other software
94+
than Home Assistant.
95+
</p>
96+
<p>
97+
If you are looking to factory reset the device, you can hold the
98+
middle button pressed for 30 seconds instead of re-installing the
99+
firmware.
100+
</p>
101+
</div>
102+
</details-page>
103+
`;
104+
}
105+
}
106+
107+
declare global {
108+
interface HTMLElementTagNameMap {
109+
'zbt1-install': ZBT1InstallPage;
110+
}
111+
}

src/styles/theme.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,9 @@
538538
--app-shadow-hover: rgba(0, 0, 0, 0.15);
539539
--app-category-bg: #e3f2fd;
540540
--app-category-text: #1976d2;
541+
542+
--mdc-theme-primary: #03a9f4;
543+
--mdc-theme-on-primary: white;
541544
}
542545

543546
html {
@@ -562,6 +565,9 @@ body.wa-dark {
562565
--app-shadow-hover: rgba(0, 0, 0, 0.5);
563566
--app-category-bg: #003c62;
564567
--app-category-text: #66d4ff;
568+
569+
--mdc-theme-primary: #03a9f4;
570+
--mdc-theme-on-primary: white;
565571
}
566572

567573
html:has(body.wa-dark) {

src/utils/tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const tools: ToolDefinition[] = [
2525
title: 'Home Assistant Connect ZBT-1',
2626
description: 'Update firmware for your Connect ZBT-1 adapter',
2727
image: '/images/zbt1.jpg',
28-
url: '/zbt1',
28+
url: '/zbt1/',
2929
},
3030
{
3131
title: 'Bluetooth proxy',

vite.config.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@ import { resolve } from 'path';
22
import { defineConfig } from 'vite';
33

44
export default defineConfig({
5+
plugins: [
6+
{
7+
name: 'py-raw-loader',
8+
transform(code, id) {
9+
if (id.endsWith('.py')) {
10+
return { code: `export default ${JSON.stringify(code)};`, map: null };
11+
}
12+
return null;
13+
},
14+
},
15+
],
16+
optimizeDeps: {
17+
esbuildOptions: {
18+
loader: {
19+
'.py': 'text',
20+
},
21+
},
22+
},
523
build: {
624
rollupOptions: {
725
input: {
@@ -24,7 +42,8 @@ export default defineConfig({
2442
__dirname,
2543
'home-assistant-connect-zwa-2/use-poe.html'
2644
),
27-
zbt1: resolve(__dirname, 'zbt1.html'),
45+
zbt1: resolve(__dirname, 'zbt1/index.html'),
46+
zbt1Install: resolve(__dirname, 'zbt1/install.html'),
2847
improv: resolve(__dirname, 'improv.html'),
2948
},
3049
},

zbt1.html renamed to zbt1/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
<link rel="icon" type="image/svg+xml" href="/favicon.png" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>ZBT1 - Device Toolbox</title>
8-
<script type="module" src="/src/pages/zbt1-details.ts"></script>
9-
<script type="module" src="/src/components/app-header.ts"></script>
10-
<script type="module" src="/src/utils/dark-mode.ts"></script>
8+
<script type="module" src="../src/pages/zbt1-details.ts"></script>
9+
<script type="module" src="../src/components/app-header.ts"></script>
10+
<script type="module" src="../src/utils/dark-mode.ts"></script>
1111
<link
1212
rel="stylesheet"
1313
href="https://early.webawesome.com/webawesome@3.0.0-beta.6/dist/styles/webawesome.css"
1414
/>
1515
<style>
16-
@import url('src/styles/shoelace.css');
17-
@import url('src/styles/theme.css');
16+
@import url('../src/styles/shoelace.css');
17+
@import url('../src/styles/theme.css');
1818
body {
1919
margin: 0;
2020
}

0 commit comments

Comments
 (0)