mirror of
https://github.com/home-assistant/frontend.git
synced 2026-04-17 15:45:43 +01:00
Add label for toggle button in area strategy (#29949)
This commit is contained in:
@@ -33,6 +33,7 @@ export class HaControlButton extends LitElement {
|
||||
--control-button-background-color: var(--disabled-color);
|
||||
--control-button-background-opacity: 0.2;
|
||||
--control-button-border-radius: var(--ha-border-radius-md);
|
||||
--control-button-font-weight: var(--ha-font-weight-medium);
|
||||
--control-button-padding: 8px;
|
||||
--mdc-icon-size: 20px;
|
||||
--ha-ripple-color: var(--secondary-text-color);
|
||||
@@ -59,7 +60,7 @@ export class HaControlButton extends LitElement {
|
||||
box-sizing: border-box;
|
||||
line-height: inherit;
|
||||
font-family: var(--ha-font-family-body);
|
||||
font-weight: var(--ha-font-weight-medium);
|
||||
font-weight: var(--control-button-font-weight);
|
||||
outline: none;
|
||||
overflow: hidden;
|
||||
background: none;
|
||||
|
||||
@@ -38,7 +38,7 @@ export class HaBadge extends LitElement {
|
||||
font-weight: var(--ha-heading-badge-font-weight, 400);
|
||||
line-height: var(--ha-heading-badge-line-height, 20px);
|
||||
letter-spacing: 0.1px;
|
||||
--mdc-icon-size: 14px;
|
||||
--mdc-icon-size: 16px;
|
||||
}
|
||||
::slotted([slot="icon"]) {
|
||||
--ha-icon-display: block;
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
SMALL_SCREEN_CONDITION,
|
||||
} from "../../lovelace/strategies/helpers/screen-conditions";
|
||||
import type { ToggleGroupCardConfig } from "../../lovelace/cards/types";
|
||||
import type { ButtonHeadingBadgeConfig } from "../../lovelace/heading-badges/types";
|
||||
|
||||
export interface LightViewStrategyConfig {
|
||||
type: "light";
|
||||
@@ -75,6 +76,7 @@ const processAreasForLight = (
|
||||
{
|
||||
type: "button",
|
||||
icon: "mdi:power",
|
||||
text: hass.localize("ui.panel.lovelace.strategy.light.off"),
|
||||
tap_action: {
|
||||
action: "perform-action",
|
||||
perform_action: "light.turn_on",
|
||||
@@ -89,11 +91,12 @@ const processAreasForLight = (
|
||||
conditions: [anyOnCondition],
|
||||
},
|
||||
],
|
||||
},
|
||||
} satisfies ButtonHeadingBadgeConfig,
|
||||
{
|
||||
type: "button",
|
||||
icon: "mdi:power",
|
||||
color: "amber",
|
||||
color: "orange",
|
||||
text: hass.localize("ui.panel.lovelace.strategy.light.on"),
|
||||
tap_action: {
|
||||
action: "perform-action",
|
||||
perform_action: "light.turn_off",
|
||||
@@ -102,7 +105,7 @@ const processAreasForLight = (
|
||||
},
|
||||
},
|
||||
visibility: [SMALL_SCREEN_CONDITION, anyOnCondition],
|
||||
},
|
||||
} satisfies ButtonHeadingBadgeConfig,
|
||||
] satisfies LovelaceCardConfig[],
|
||||
});
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ export class HuiButtonHeadingBadge
|
||||
var(--ha-border-radius-pill)
|
||||
);
|
||||
--control-button-padding: 0;
|
||||
--mdc-icon-size: var(--ha-heading-badge-icon-size, 14px);
|
||||
--mdc-icon-size: var(--ha-heading-badge-icon-size, 16px);
|
||||
width: auto;
|
||||
height: var(--ha-heading-badge-size, 26px);
|
||||
min-width: var(--ha-heading-badge-size, 26px);
|
||||
@@ -121,6 +121,8 @@ export class HuiButtonHeadingBadge
|
||||
--control-button-icon-color: var(--color);
|
||||
--control-button-background-color: var(--color);
|
||||
--control-button-focus-color: var(--color);
|
||||
--control-button-background-opacity: 0.2;
|
||||
--control-button-font-weight: var(--ha-font-weight-bold);
|
||||
--ha-ripple-color: var(--color);
|
||||
}
|
||||
.content {
|
||||
|
||||
@@ -8089,7 +8089,9 @@
|
||||
},
|
||||
"light": {
|
||||
"lights": "Lights",
|
||||
"other_lights": "Other lights"
|
||||
"other_lights": "Other lights",
|
||||
"on": "On",
|
||||
"off": "Off"
|
||||
},
|
||||
"security": {
|
||||
"devices": "Devices",
|
||||
|
||||
Reference in New Issue
Block a user