Skip to content

Commit

Permalink
Make update available less obtrusive (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob authored Jun 11, 2024
1 parent 16bb999 commit 08fe257
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
4 changes: 2 additions & 2 deletions raw_package/static/css/esphome-2.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
--mdc-theme-on-primary: white;
--mdc-dialog-heading-ink-color: #212121;
--mdc-dialog-content-ink-color: #212121;
--update-available-color: #2e3dd4;
--highlight-button-color: #2e3dd4;
--status-connected: #444444;
--status-new: #ffa500;
--status-imported: #4caf50;
Expand Down Expand Up @@ -52,7 +52,7 @@
--mdc-ripple-color: #282828;
--mdc-text-field-fill-color: #3d3d3d;
--mdc-theme-text-secondary-on-background: #e1e1e1;
--update-available-color: #5f7eeb;
--highlight-button-color: #5f7eeb;
--status-connected: #cecece;
--mdc-ripple-color: #bebebe;
}
Expand Down
13 changes: 3 additions & 10 deletions src/devices/configured-device-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const UPDATE_TO_ICON = "➡️";
const STATUS_COLORS = {
NEW: "var(--status-new)",
OFFLINE: "var(--alert-error-color)",
"UPDATE AVAILABLE": "var(--update-available-color)",
ONLINE: "var(--status-connected)",
};

Expand Down Expand Up @@ -81,11 +80,9 @@ class ESPHomeConfiguredDeviceCard extends LitElement {
const updateAvailable = canUpdateDevice(this.device);
const status = this._highlight
? "NEW"
: this.onlineStatus && updateAvailable
? "UPDATE AVAILABLE"
: this.onlineStatus
? "ONLINE"
: "OFFLINE";
: this.onlineStatus
? "ONLINE"
: "OFFLINE";
return html`
<esphome-card
.status=${status}
Expand All @@ -108,7 +105,6 @@ class ESPHomeConfiguredDeviceCard extends LitElement {
<div class="tooltip-container">
<mwc-button
@click=${this._handleInstall}
class="update-available"
icon="system_update"
label="Update"
></mwc-button>
Expand Down Expand Up @@ -231,9 +227,6 @@ class ESPHomeConfiguredDeviceCard extends LitElement {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo,
Courier, monospace;
}
.card-actions mwc-button.update-available {
--mdc-theme-primary: var(--update-available-color);
}
esphome-button-menu {
--mdc-theme-text-icon-on-background: var(--primary-text-color);
}
Expand Down
2 changes: 1 addition & 1 deletion web.esphome.io/src/dashboard/esp-device-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class EWESPDeviceCard extends LitElement {
--mdc-theme-text-icon-on-background: var(--primary-text-color);
}
mwc-button.first-use {
--mdc-theme-primary: var(--update-available-color);
--mdc-theme-primary: var(--highlight-button-color);
}
`,
];
Expand Down

0 comments on commit 08fe257

Please sign in to comment.