Compare commits

..

1 Commits

Author SHA1 Message Date
Aidan Timson
186e265b66 Migrate state card button to control button 2026-02-03 13:55:01 +00:00
12 changed files with 58 additions and 31 deletions

View File

@@ -222,7 +222,6 @@ export class BluetoothAdvertisementMonitorPanel extends LitElement {
filter=${this.address || ""}
clickable
.tabs=${bluetoothTabs}
back-path="/config"
></hass-tabs-subpage-data-table>
`;
}

View File

@@ -161,7 +161,6 @@ export class BluetoothConfigDashboard extends LitElement {
.hass=${this.hass}
.route=${this.route}
.tabs=${bluetoothTabs}
back-path="/config"
>
<div class="content">
<ha-card

View File

@@ -225,7 +225,6 @@ export class BluetoothConnectionMonitorPanel extends LitElement {
)}
@grouping-changed=${this._handleGroupingChanged}
@collapsed-changed=${this._handleCollapseChanged}
back-path="/config"
></hass-tabs-subpage-data-table>
`;
}

View File

@@ -124,7 +124,6 @@ export class BluetoothNetworkVisualization extends LitElement {
.narrow=${this.narrow}
.route=${this.route}
.tabs=${bluetoothTabs}
back-path="/config"
>
<ha-network-graph
.hass=${this.hass}

View File

@@ -111,7 +111,6 @@ class ZHAConfigDashboard extends LitElement {
.narrow=${this.narrow}
.route=${this.route}
.tabs=${zhaTabs}
back-path="/config"
has-fab
>
<div class="container">

View File

@@ -101,7 +101,6 @@ export class ZHAGroupsDashboard extends LitElement {
return html`
<hass-tabs-subpage-data-table
.tabs=${zhaTabs}
back-path="/config"
.hass=${this.hass}
.narrow=${this.narrow}
.route=${this.route}

View File

@@ -54,7 +54,6 @@ export class ZHANetworkVisualizationPage extends LitElement {
return html`
<hass-tabs-subpage
.tabs=${zhaTabs}
back-path="/config"
.hass=${this.hass}
.narrow=${this.narrow}
.isWide=${this.isWide}

View File

@@ -151,7 +151,6 @@ class ZWaveJSConfigDashboard extends SubscribeMixin(LitElement) {
.narrow=${this.narrow}
.route=${this.route}
.tabs=${configTabs}
back-path="/config"
has-fab
>
<ha-icon-button

View File

@@ -67,7 +67,6 @@ class ZWaveJSLogs extends SubscribeMixin(LitElement) {
.narrow=${this.narrow}
.route=${this.route}
.tabs=${configTabs}
back-path="/config"
>
<div class="container">
<ha-card>

View File

@@ -77,7 +77,6 @@ export class ZWaveJSNetworkVisualization extends SubscribeMixin(LitElement) {
.narrow=${this.narrow}
.route=${this.route}
.tabs=${configTabs}
back-path="/config"
>
<ha-network-graph
.hass=${this.hass}

View File

@@ -1,10 +1,11 @@
import type { HassEntity } from "home-assistant-js-websocket";
import type { CSSResultGroup } from "lit";
import { html, LitElement } from "lit";
import { css, html, LitElement } from "lit";
import { customElement, property } from "lit/decorators";
import "../components/entity/ha-entity-toggle";
import "../components/entity/state-info";
import "../components/ha-button";
import "../components/ha-control-button-group";
import "../components/ha-control-button";
import { UNAVAILABLE } from "../data/entity/entity";
import { haStyle } from "../resources/styles";
import type { HomeAssistant } from "../types";
@@ -26,14 +27,14 @@ class StateCardButton extends LitElement {
.stateObj=${stateObj}
.inDialog=${this.inDialog}
></state-info>
<ha-button
appearance="plain"
size="small"
@click=${this._pressButton}
.disabled=${stateObj.state === UNAVAILABLE}
>
${this.hass.localize("ui.card.button.press")}
</ha-button>
<ha-control-button-group>
<ha-control-button
.disabled=${stateObj.state === UNAVAILABLE}
@click=${this._pressButton}
>
${this.hass.localize("ui.card.button.press")}
</ha-control-button>
</ha-control-button-group>
</div>
`;
}
@@ -46,7 +47,24 @@ class StateCardButton extends LitElement {
}
static get styles(): CSSResultGroup {
return haStyle;
return [
haStyle,
css`
ha-control-button-group > ha-control-button {
--control-button-padding: var(--ha-space-4);
}
ha-control-button {
--control-button-focus-color: var(
--feature-color,
var(--primary-color)
);
--control-button-icon-color: var(
--feature-color,
var(--primary-color)
);
}
`,
];
}
}

View File

@@ -1,10 +1,11 @@
import type { HassEntity } from "home-assistant-js-websocket";
import type { CSSResultGroup } from "lit";
import { html, LitElement } from "lit";
import { css, html, LitElement } from "lit";
import { customElement, property } from "lit/decorators";
import "../components/entity/ha-entity-toggle";
import "../components/entity/state-info";
import "../components/ha-button";
import "../components/ha-control-button-group";
import "../components/ha-control-button";
import { UNAVAILABLE } from "../data/entity/entity";
import { haStyle } from "../resources/styles";
import type { HomeAssistant } from "../types";
@@ -26,13 +27,14 @@ class StateCardInputButton extends LitElement {
.stateObj=${stateObj}
.inDialog=${this.inDialog}
></state-info>
<ha-button
appearance="plain"
@click=${this._pressButton}
.disabled=${stateObj.state === UNAVAILABLE}
>
${this.hass.localize("ui.card.button.press")}
</ha-button>
<ha-control-button-group>
<ha-control-button
.disabled=${stateObj.state === UNAVAILABLE}
@click=${this._pressButton}
>
${this.hass.localize("ui.card.button.press")}
</ha-control-button>
</ha-control-button-group>
</div>
`;
}
@@ -45,7 +47,24 @@ class StateCardInputButton extends LitElement {
}
static get styles(): CSSResultGroup {
return haStyle;
return [
haStyle,
css`
ha-control-button-group > ha-control-button {
--control-button-padding: var(--ha-space-4);
}
ha-control-button {
--control-button-focus-color: var(
--feature-color,
var(--primary-color)
);
--control-button-icon-color: var(
--feature-color,
var(--primary-color)
);
}
`,
];
}
}