Skip to content

Commit cd585d9

Browse files
authored
Beta fixes (#189)
1 parent 25017fe commit cd585d9

File tree

20 files changed

+443
-452
lines changed

20 files changed

+443
-452
lines changed

src/adopt/adopt-dialog.ts

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { fireEvent } from "../util/fire-event";
88
import { ImportableDevice, importDevice } from "../api/devices";
99
import { checkHasWifiSecrets, storeWifiSecrets } from "../api/wifi";
1010
import { openInstallChooseDialog } from "../install-choose";
11+
import { esphomeDialogStyles } from "../styles";
1112

1213
@customElement("esphome-adopt-dialog")
1314
class ESPHomeAdoptDialog extends LitElement {
@@ -51,8 +52,8 @@ class ESPHomeAdoptDialog extends LitElement {
5152
: html`
5253
<div>
5354
Adopting ${this.device.name} will create an ESPHome
54-
configuration for this device allowing you to install updates
55-
and customize the original firmware.
55+
configuration for this device. This allows you to install
56+
updates and customize the original firmware.
5657
</div>
5758
5859
${this._error
@@ -103,6 +104,7 @@ class ESPHomeAdoptDialog extends LitElement {
103104
? ""
104105
: html`
105106
<mwc-button
107+
no-attention
106108
slot="secondaryAction"
107109
label="Cancel"
108110
dialogAction="cancel"
@@ -163,22 +165,18 @@ class ESPHomeAdoptDialog extends LitElement {
163165
}
164166
}
165167

166-
static styles = css`
167-
:host {
168-
--mdc-dialog-max-width: 390px;
169-
}
170-
mwc-textfield {
171-
display: block;
172-
margin-top: 16px;
173-
}
174-
div + div {
175-
margin-top: 16px;
176-
}
177-
.error {
178-
color: #db4437;
179-
margin-bottom: 16px;
180-
}
181-
`;
168+
static styles = [
169+
esphomeDialogStyles,
170+
css`
171+
:host {
172+
--mdc-dialog-max-width: 390px;
173+
}
174+
.error {
175+
color: var(--alert-error-color);
176+
margin-bottom: 16px;
177+
}
178+
`,
179+
];
182180
}
183181

184182
declare global {

src/components/process-dialog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class ESPHomeProcessDialog extends LitElement {
5858
}
5959
6060
esphome-remote-process {
61-
--remote-process-height: calc(90vh - 128px);
61+
height: calc(90vh - 128px);
6262
}
6363
`;
6464
}

src/components/remote-process.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ class ESPHomeRemoteProcess extends HTMLElement {
1919
const shadowRoot = this.attachShadow({ mode: "open" });
2020

2121
shadowRoot.innerHTML = `
22-
<style>${coloredConsoleStyles}</style>
22+
<style>
23+
:host {
24+
display: flex;
25+
}
26+
${coloredConsoleStyles}
27+
</style>
2328
<div class="log"></div>
2429
`;
2530

src/const.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,3 @@ export interface Logger {
2727
error(msg: string, ...args: any[]): void;
2828
debug(msg: string, ...args: any[]): void;
2929
}
30-
31-
export const DOCS_WEBSERIAL =
32-
"https://esphome.io/guides/getting_started_hassio.html#webserial";

src/devices/configured-device-card.ts

Lines changed: 33 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { openInstallChooseDialog } from "../install-choose";
1717
import { openLogsTargetDialog } from "../logs-target";
1818
import { fireEvent } from "../util/fire-event";
1919
import { openDeleteDeviceDialog } from "../delete-device";
20+
import { esphomeCardStyles } from "../styles";
2021

2122
const UPDATE_TO_ICON = "➡️";
2223
const STATUS_COLORS = {
@@ -29,7 +30,7 @@ const STATUS_COLORS = {
2930
@customElement("esphome-configured-device-card")
3031
class ESPHomeConfiguredDeviceCard extends LitElement {
3132
@property() public device!: ConfiguredDevice;
32-
@property() public onlineStatus = false;
33+
@property() public onlineStatus?: boolean;
3334
@property() public highlightOnAdd = false;
3435
@state() private _highlight = false;
3536

@@ -69,7 +70,9 @@ class ESPHomeConfiguredDeviceCard extends LitElement {
6970
? "OFFLINE"
7071
: updateAvailable
7172
? "UPDATE AVAILABLE"
72-
: "ONLINE";
73+
: this.onlineStatus === true
74+
? "ONLINE"
75+
: undefined;
7376
return html`
7477
<esphome-card
7578
.status=${status}
@@ -143,56 +146,34 @@ class ESPHomeConfiguredDeviceCard extends LitElement {
143146
}
144147
}
145148

146-
static styles = css`
147-
:host {
148-
--update-available-color: #2e3dd4;
149-
}
150-
esphome-card {
151-
height: 100%;
152-
display: flex;
153-
flex-direction: column;
154-
}
155-
.device-config-path {
156-
margin-bottom: 8px;
157-
font-size: 14px;
158-
}
159-
.inlinecode {
160-
box-sizing: border-box;
161-
padding: 0.2em 0.4em;
162-
margin: 0;
163-
font-size: 85%;
164-
background-color: rgba(27, 31, 35, 0.05);
165-
border-radius: 3px;
166-
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier,
167-
monospace;
168-
}
169-
.card-actions {
170-
display: flex;
171-
padding: 4px;
172-
}
173-
.flex {
174-
flex: 1;
175-
}
176-
.card-actions a {
177-
text-decoration: none;
178-
}
179-
mwc-button {
180-
--mdc-theme-primary: rgba(0, 0, 0, 0.88);
181-
}
182-
esphome-button-menu {
183-
cursor: pointer;
184-
}
185-
mwc-icon-button {
186-
--mdc-icon-button-size: 32px;
187-
}
188-
.update-available {
189-
--mdc-theme-primary: var(--update-available-color);
190-
}
191-
192-
.tooltip-container {
193-
display: inline-block;
194-
}
195-
`;
149+
static styles = [
150+
esphomeCardStyles,
151+
css`
152+
:host {
153+
--update-available-color: #2e3dd4;
154+
}
155+
.device-config-path {
156+
margin-bottom: 8px;
157+
font-size: 14px;
158+
}
159+
.inlinecode {
160+
box-sizing: border-box;
161+
padding: 0.2em 0.4em;
162+
margin: 0;
163+
font-size: 85%;
164+
background-color: rgba(27, 31, 35, 0.05);
165+
border-radius: 3px;
166+
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo,
167+
Courier, monospace;
168+
}
169+
.card-actions mwc-button.update-available {
170+
--mdc-theme-primary: var(--update-available-color);
171+
}
172+
.tooltip-container {
173+
display: inline-block;
174+
}
175+
`,
176+
];
196177

197178
private _handleOverflowAction(ev: CustomEvent<ActionDetail>) {
198179
switch (ev.detail.index) {

src/devices/importable-device-card.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import "@material/mwc-button";
55
import "../components/esphome-card";
66
import { fireEvent } from "../util/fire-event";
77
import { openAdoptDialog } from "../adopt";
8+
import { esphomeCardStyles } from "../styles";
89

910
@customElement("esphome-importable-device-card")
1011
class ESPHomeImportableDeviceCard extends LitElement {
@@ -38,20 +39,17 @@ class ESPHomeImportableDeviceCard extends LitElement {
3839
}, 1000);
3940
}
4041

41-
static styles = css`
42-
esphome-card {
43-
--status-color: #4caf50;
44-
height: 100%;
45-
display: flex;
46-
flex-direction: column;
47-
}
48-
.flex {
49-
flex: 1;
50-
}
51-
mwc-button {
52-
--mdc-theme-primary: #4caf50;
53-
}
54-
`;
42+
static styles = [
43+
esphomeCardStyles,
44+
css`
45+
esphome-card {
46+
--status-color: #4caf50;
47+
}
48+
.card-actions mwc-button {
49+
--mdc-theme-primary: #4caf50;
50+
}
51+
`,
52+
];
5553

5654
private async _handleAdopt() {
5755
openAdoptDialog(this.device, () => fireEvent(this, "adopted"));

0 commit comments

Comments
 (0)