Compare commits

..

2 Commits

Author SHA1 Message Date
Paul Bottein
0cbf0ca08c Use not 2026-02-03 14:02:10 +01:00
Paul Bottein
130cbb3309 Add toggle lights button on light dashboard 2026-02-03 14:02:10 +01:00
11 changed files with 42 additions and 10 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

@@ -45,6 +45,16 @@ const processAreasForLight = (
}
if (areaCards.length > 0) {
// Visibility condition: any light is on
const anyOnCondition = {
condition: "or" as const,
conditions: areaLights.map((entityId) => ({
condition: "state" as const,
entity: entityId,
state: "on",
})),
};
cards.push({
heading_style: "subtitle",
type: "heading",
@@ -53,6 +63,38 @@ const processAreasForLight = (
action: "navigate",
navigation_path: `/home/areas-${area.area_id}`,
},
badges: [
{
type: "button",
icon: "mdi:power",
tap_action: {
action: "perform-action",
perform_action: "light.turn_on",
target: {
area_id: area.area_id,
},
},
visibility: [
{
condition: "not",
conditions: [anyOnCondition],
},
],
},
{
type: "button",
icon: "mdi:power",
color: "orange",
tap_action: {
action: "perform-action",
perform_action: "light.turn_off",
target: {
area_id: area.area_id,
},
},
visibility: [anyOnCondition],
},
] satisfies LovelaceCardConfig[],
});
cards.push(...areaCards);
}