Skip to content

Commit 7a8835b

Browse files
committed
Remove warning card code
1 parent 3e7698c commit 7a8835b

File tree

8 files changed

+21
-207
lines changed

8 files changed

+21
-207
lines changed

src-11ty/home-assistant-connect-zwa-2/install-portable.njk

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ permalink: /home-assistant-connect-zwa-2/install-portable/index.html
7979
border-radius: 16px;
8080
}
8181
82-
warning-card::part(container) {
83-
margin: 10px 20px 20px;
84-
}
85-
8682
install-esphome-firmware .min-h-screen {
8783
min-height: auto !important;
8884
}
@@ -139,7 +135,6 @@ permalink: /home-assistant-connect-zwa-2/install-portable/index.html
139135
</style>
140136

141137
<script type="module">
142-
import { isSerialUnavailable } from '/src/utils/const.ts';
143138
144139
document.addEventListener('DOMContentLoaded', () => {
145140
const installerScript = document.createElement('script');
@@ -148,15 +143,6 @@ permalink: /home-assistant-connect-zwa-2/install-portable/index.html
148143
document.head.appendChild(installerScript);
149144
});
150145
151-
if (isSerialUnavailable) {
152-
const installerContainer = document.getElementById('installer-container');
153-
installerContainer.className = '';
154-
installerContainer.innerHTML = '';
155-
156-
const warningCard = document.createElement('warning-card');
157-
installerContainer.appendChild(warningCard);
158-
}
159-
160146
customElements.whenDefined('zwa2-install-portable').then(() => {
161147
setTimeout(() => {
162148
document.getElementById('troubleshooting').style.display = 'block';

src-11ty/home-assistant-connect-zwa-2/install.njk

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ permalink: /home-assistant-connect-zwa-2/install/index.html
3838
min-height: auto !important;
3939
}
4040
41-
warning-card::part(container) {
42-
margin: -5px 20px 20px;
43-
}
44-
4541
a {
4642
color: #03a9f4;
4743
text-decoration: none;
@@ -166,9 +162,6 @@ permalink: /home-assistant-connect-zwa-2/install/index.html
166162
</div>
167163

168164
<script type="module">
169-
import '/src/components/warning-card.js';
170-
import { isSerialUnavailable } from '/src/utils/const.ts';
171-
172165
document.addEventListener('DOMContentLoaded', () => {
173166
const installerScript = document.createElement('script');
174167
installerScript.type = 'module';
@@ -177,12 +170,4 @@ permalink: /home-assistant-connect-zwa-2/install/index.html
177170
document.head.appendChild(installerScript);
178171
});
179172
180-
if (isSerialUnavailable) {
181-
const installerContainer = document.getElementById('installer-container');
182-
installerContainer.className = '';
183-
installerContainer.innerHTML = '';
184-
185-
const warningCard = document.createElement('warning-card');
186-
installerContainer.appendChild(warningCard);
187-
}
188173
</script>

src-11ty/home-assistant-connect-zwa-2/use-poe.njk

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ permalink: /home-assistant-connect-zwa-2/use-poe/index.html
8888
border-radius: 16px;
8989
}
9090
91-
warning-card::part(container) {
92-
margin: 10px 20px 20px;
93-
}
94-
9591
install-esp-bridge-firmware .min-h-screen {
9692
min-height: auto !important;
9793
}
@@ -148,24 +144,13 @@ permalink: /home-assistant-connect-zwa-2/use-poe/index.html
148144
</style>
149145

150146
<script type="module">
151-
import { isSerialUnavailable } from '/src/utils/const.ts';
152-
153147
document.addEventListener('DOMContentLoaded', () => {
154148
const installerScript = document.createElement('script');
155149
installerScript.type = 'module';
156150
installerScript.src = 'https://home-assistant.github.io/zwa2-toolbox/standalone/install-esp-bridge-firmware.js';
157151
document.head.appendChild(installerScript);
158152
});
159153
160-
if (isSerialUnavailable) {
161-
const installerContainer = document.getElementById('installer-container');
162-
installerContainer.className = '';
163-
installerContainer.innerHTML = '';
164-
165-
const warningCard = document.createElement('warning-card');
166-
installerContainer.appendChild(warningCard);
167-
}
168-
169154
customElements.whenDefined('zwa2-install-poe').then(() => {
170155
setTimeout(() => {
171156
document.getElementById('troubleshooting').style.display = 'block';

src-11ty/zbt1/install.njk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ permalink: /zbt1/install/index.html
3838
min-height: auto !important;
3939
}
4040
41-
warning-card::part(container) {
42-
margin: -5px 20px 20px;
43-
}
44-
4541
a {
4642
color: #03a9f4;
4743
text-decoration: none;

src/components/warning-card.ts

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/pages/vpe-install.ts

Lines changed: 21 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { LitElement, css, html } from 'lit';
22
import { customElement } from 'lit/decorators.js';
33

44
import '../components/details.js';
5-
import '../components/warning-card.js';
6-
import { isSerialUnavailable } from '../utils/const.js';
75

86
@customElement('vpe-install')
97
export class VPEInstallPage extends LitElement {
@@ -14,37 +12,6 @@ export class VPEInstallPage extends LitElement {
1412
color: var(--app-text-primary);
1513
}
1614
17-
.fallback-container {
18-
padding: 20px;
19-
}
20-
21-
.back-button {
22-
display: inline-flex;
23-
align-items: center;
24-
gap: 8px;
25-
color: var(--wa-color-brand-50);
26-
text-decoration: none;
27-
padding: 8px 16px;
28-
border-radius: 8px;
29-
transition: all 0.2s ease;
30-
margin-bottom: 50px;
31-
background: var(--app-category-bg);
32-
}
33-
34-
.back-button:hover {
35-
background: var(--app-bg-secondary);
36-
}
37-
38-
.back-button svg {
39-
margin-top: 2px;
40-
width: 14px;
41-
height: 14px;
42-
}
43-
44-
.warning-card {
45-
margin: 0 -40px;
46-
}
47-
4815
p[slot='subtitle'] {
4916
color: var(--wa-color-brand-50);
5017
font-size: 1.1rem;
@@ -64,56 +31,29 @@ export class VPEInstallPage extends LitElement {
6431
}
6532
`;
6633

67-
private _goBack() {
68-
window.location.href = '/vpe/';
69-
}
70-
7134
render() {
72-
return isSerialUnavailable
73-
? html`
74-
<div class="fallback-container">
75-
<a
76-
href="/"
77-
class="back-button"
78-
@click=${(e: Event) => {
79-
e.preventDefault();
80-
this._goBack();
81-
}}
82-
>
83-
<svg viewBox="0 0 16 16" fill="currentColor">
84-
<path
85-
d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"
86-
/>
87-
</svg>
88-
Back
89-
</a>
90-
<div class="warning-card">
91-
<warning-card></warning-card>
92-
</div>
93-
</div>
94-
`
95-
: html`
96-
<details-page back-href="/vpe/" back-label="Back">
97-
<span slot="title">Install firmware</span>
98-
<p slot="subtitle">
99-
Flash the latest Voice PE firmware directly to your device using
100-
our web installer
101-
</p>
102-
<p slot="description">
103-
Home Assistant will be able to provide the latest firmware when
104-
you have the Home Assistant Voice Preview Edition set up. To
105-
factory reset the device, you can hold the middle button pressed
106-
for 30 seconds or install new firmware below:
107-
</p>
35+
return html`
36+
<details-page back-href="/vpe/" back-label="Back">
37+
<span slot="title">Install firmware</span>
38+
<p slot="subtitle">
39+
Flash the latest Voice PE firmware directly to your device using our
40+
web installer
41+
</p>
42+
<p slot="description">
43+
Home Assistant will be able to provide the latest firmware when you
44+
have the Home Assistant Voice Preview Edition set up. To factory reset
45+
the device, you can hold the middle button pressed for 30 seconds or
46+
install new firmware below:
47+
</p>
10848
109-
<div slot="footer" class="footer-content">
110-
<esp-web-install-button
111-
manifest="https://firmware.esphome.io/home-assistant-voice-pe/home-assistant-voice/manifest.json"
112-
>
113-
</esp-web-install-button>
114-
</div>
115-
</details-page>
116-
`;
49+
<div slot="footer" class="footer-content">
50+
<esp-web-install-button
51+
manifest="https://firmware.esphome.io/home-assistant-voice-pe/home-assistant-voice/manifest.json"
52+
>
53+
</esp-web-install-button>
54+
</div>
55+
</details-page>
56+
`;
11757
}
11858
}
11959

src/pages/zwa2-install-poe.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { LitElement, css, html } from 'lit';
22
import { customElement } from 'lit/decorators.js';
33

44
import '../components/details.js';
5-
import '../components/warning-card.js';
65

76
@customElement('zwa2-install-poe')
87
export class Zwa2InstallPoEPage extends LitElement {

src/utils/const.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)