From 04db2615ff9683202e1e1acafe80a4d66b03e1fb Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Thu, 30 May 2024 12:52:12 +0200 Subject: [PATCH] Alarm control panel code dialog (#1437) * Use code dialog to arm and disarm instead of the keypad * Set the right minimal version for HA --- docs/cards/alarm-control-panel.md | 1 - hacs.json | 2 +- .../alarm-control-panel-card-config.ts | 12 +- .../alarm-control-panel-card-editor.ts | 6 - .../alarm-control-panel-card.ts | 145 +------- src/ha/data/alarm_control_panel.ts | 112 ++++++ src/ha/data/entity_registry.ts | 5 + src/translations/ar.json | 3 - src/translations/bg.json | 5 +- src/translations/ca.json | 3 - src/translations/cs.json | 5 +- src/translations/da.json | 3 - src/translations/de.json | 3 - src/translations/en.json | 3 - src/translations/es.json | 7 +- src/translations/fi.json | 3 - src/translations/fr.json | 3 - src/translations/he.json | 5 +- src/translations/hu.json | 3 - src/translations/id.json | 3 - src/translations/it.json | 3 - src/translations/ko-KR.json | 329 +++++++++--------- src/translations/nl.json | 3 - src/translations/pl.json | 5 +- src/translations/ro.json | 3 - src/translations/ru.json | 3 - src/translations/sk.json | 7 +- src/translations/sl.json | 5 +- src/translations/uk.json | 3 - src/translations/vi.json | 3 - src/translations/zh-Hans.json | 3 - src/translations/zh-Hant.json | 5 +- src/utils/icons/alarm-panel-icon.ts | 18 - 33 files changed, 309 insertions(+), 413 deletions(-) create mode 100644 src/ha/data/alarm_control_panel.ts delete mode 100644 src/utils/icons/alarm-panel-icon.ts diff --git a/docs/cards/alarm-control-panel.md b/docs/cards/alarm-control-panel.md index 15151d839..3a35838fc 100644 --- a/docs/cards/alarm-control-panel.md +++ b/docs/cards/alarm-control-panel.md @@ -22,7 +22,6 @@ All the options are available in the lovelace editor but you can use `yaml` if y | `secondary_info` | `name` `state` `last-changed` `last-updated` `none` | `state` | Info to show as secondary info | | `icon_type` | `icon` `entity-picture` `none` | `icon` | Type of icon to display | | `states` | list | `["armed_home", "armed_away"]` | List of arm states to display | -| `show_keypad` | boolean | `false` | Show the keypad | | `tap_action` | action | `more-info` | Home assistant action to perform on tap | | `hold_action` | action | `more-info` | Home assistant action to perform on hold | | `double_tap_action` | action | `more-info` | Home assistant action to perform on double_tap | diff --git a/hacs.json b/hacs.json index 45bc73fd4..8f06e6117 100644 --- a/hacs.json +++ b/hacs.json @@ -1,6 +1,6 @@ { "name": "Mushroom", "filename": "mushroom.js", - "homeassistant": "2023.7.0", + "homeassistant": "2024.3.0", "render_readme": true } diff --git a/src/cards/alarm-control-panel-card/alarm-control-panel-card-config.ts b/src/cards/alarm-control-panel-card/alarm-control-panel-card-config.ts index 73080779e..c0e3936dd 100644 --- a/src/cards/alarm-control-panel-card/alarm-control-panel-card-config.ts +++ b/src/cards/alarm-control-panel-card/alarm-control-panel-card-config.ts @@ -1,4 +1,4 @@ -import { array, assign, boolean, object, optional } from "superstruct"; +import { array, assign, boolean, deprecated, object, optional } from "superstruct"; import { LovelaceCardConfig } from "../../ha"; import { ActionsSharedConfig, actionsSharedConfigStruct } from "../../shared/config/actions-config"; import { @@ -7,13 +7,13 @@ import { } from "../../shared/config/appearance-config"; import { EntitySharedConfig, entitySharedConfigStruct } from "../../shared/config/entity-config"; import { lovelaceCardConfigStruct } from "../../shared/config/lovelace-card-config"; +import { AlarmMode } from "../../ha/data/alarm_control_panel"; export type AlarmControlPanelCardConfig = LovelaceCardConfig & EntitySharedConfig & AppearanceSharedConfig & ActionsSharedConfig & { - states?: string[]; - show_keypad?: boolean; + states?: AlarmMode[]; }; export const alarmControlPanelCardCardConfigStruct = assign( @@ -21,6 +21,10 @@ export const alarmControlPanelCardCardConfigStruct = assign( assign(entitySharedConfigStruct, appearanceSharedConfigStruct, actionsSharedConfigStruct), object({ states: optional(array()), - show_keypad: optional(boolean()), + show_keypad: deprecated(optional(boolean()), (_value, ctx) => { + console.warn( + `🍄 "${ctx.path}" option is deprecated and no longer available. Remove it from your YAML configuration or use the built-in Home Assistant alarm panel card if you want keypad.` + ); + }), }) ); diff --git a/src/cards/alarm-control-panel-card/alarm-control-panel-card-editor.ts b/src/cards/alarm-control-panel-card/alarm-control-panel-card-editor.ts index b2f5c3c7f..30597036f 100644 --- a/src/cards/alarm-control-panel-card/alarm-control-panel-card-editor.ts +++ b/src/cards/alarm-control-panel-card/alarm-control-panel-card-editor.ts @@ -21,8 +21,6 @@ const actions: UiAction[] = ["more-info", "navigate", "url", "call-service", "as const states = ["armed_home", "armed_away", "armed_night", "armed_vacation", "armed_custom_bypass"]; -const ALARM_CONTROL_PANEL_LABELS = ["show_keypad"]; - const computeSchema = memoizeOne((localize: LocalizeFunc): HaFormSchema[] => [ { name: "entity", selector: { entity: { domain: ALARM_CONTROl_PANEL_ENTITY_DOMAINS } } }, { name: "name", selector: { text: {} } }, @@ -36,7 +34,6 @@ const computeSchema = memoizeOne((localize: LocalizeFunc): HaFormSchema[] => [ localize(`ui.card.alarm_control_panel.${state.replace("armed", "arm")}`), ]) as [string, string][], }, - { name: "show_keypad", selector: { boolean: {} } }, ...computeActionsFormSchema(actions), ]); @@ -78,9 +75,6 @@ export class SwitchCardEditor extends MushroomBaseElement implements LovelaceCar if (GENERIC_LABELS.includes(schema.name)) { return customLocalize(`editor.card.generic.${schema.name}`); } - if (ALARM_CONTROL_PANEL_LABELS.includes(schema.name)) { - return customLocalize(`editor.card.alarm_control_panel.${schema.name}`); - } if (schema.name === "states") { return this.hass!.localize( "ui.panel.lovelace.editor.card.alarm-panel.available_states" diff --git a/src/cards/alarm-control-panel-card/alarm-control-panel-card.ts b/src/cards/alarm-control-panel-card/alarm-control-panel-card.ts index f6f2e6a74..0aba4862a 100644 --- a/src/cards/alarm-control-panel-card/alarm-control-panel-card.ts +++ b/src/cards/alarm-control-panel-card/alarm-control-panel-card.ts @@ -1,6 +1,6 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResultGroup, html, nothing, PropertyValues, TemplateResult } from "lit"; -import { customElement, query } from "lit/decorators.js"; +import { customElement } from "lit/decorators.js"; import { classMap } from "lit/directives/class-map.js"; import { styleMap } from "lit/directives/style-map.js"; import { @@ -12,8 +12,8 @@ import { HomeAssistant, LovelaceCard, LovelaceCardEditor, - LovelaceLayoutOptions, } from "../../ha"; +import { ALARM_MODES, AlarmMode, setProtectedAlarmControlPanelMode } from "../../ha/data/alarm_control_panel"; import "../../shared/badge-icon"; import "../../shared/button"; import "../../shared/button-group"; @@ -25,7 +25,6 @@ import { computeAppearance } from "../../utils/appearance"; import { MushroomBaseCard } from "../../utils/base-card"; import { cardStyle } from "../../utils/card-styles"; import { registerCustomCard } from "../../utils/custom-cards"; -import { alarmPanelIconAction } from "../../utils/icons/alarm-panel-icon"; import { computeEntityPicture } from "../../utils/info"; import { AlarmControlPanelCardConfig } from "./alarm-control-panel-card-config"; import { @@ -33,14 +32,7 @@ import { ALARM_CONTROl_PANEL_CARD_NAME, ALARM_CONTROl_PANEL_ENTITY_DOMAINS, } from "./const"; -import { - getStateColor, - getStateService, - hasCode, - isActionsAvailable, - isDisarmed, - shouldPulse, -} from "./utils"; +import { getStateColor, hasCode, isActionsAvailable, isDisarmed, shouldPulse } from "./utils"; registerCustomCard({ type: ALARM_CONTROl_PANEL_CARD_NAME, @@ -49,14 +41,10 @@ registerCustomCard({ }); type ActionButtonType = { - state: string; + mode: AlarmMode; disabled?: boolean; }; -type HaTextField = any; - -const BUTTONS = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "", "0", "clear"]; - /* * Ref: https://github.com/home-assistant/frontend/blob/dev/src/panels/lovelace/cards/hui-alarm-panel-card.ts * TODO: customize icon for modes (advanced YAML configuration) @@ -88,68 +76,15 @@ export class AlarmControlPanelCard return Boolean(this._config?.states?.length); } - public getLayoutOptions(): LovelaceLayoutOptions { - const options = super.getLayoutOptions(); - if (this._config?.show_keypad) { - delete options.grid_columns; - delete options.grid_rows; - } - return options; - } - - @query("#alarmCode") private _input?: HaTextField; - - setConfig(config: AlarmControlPanelCardConfig): void { - super.setConfig(config); - this.loadComponents(); - } - - protected updated(changedProperties: PropertyValues) { - super.updated(changedProperties); - if (this.hass && changedProperties.has("hass")) { - this.loadComponents(); - } - } - - async loadComponents() { - const stateObj = this._stateObj; - - if (stateObj && hasCode(stateObj)) { - void import("../../shared/form/mushroom-textfield"); - } - } - - private _onTap(e: MouseEvent, state: string): void { - const service = getStateService(state); - if (!service) return; + private _onTap(e: MouseEvent, mode: AlarmMode): void { e.stopPropagation(); - const code = this._input?.value || undefined; - this.hass.callService("alarm_control_panel", service, { - entity_id: this._config?.entity, - code, - }); - if (this._input) { - this._input.value = ""; - } - } - - private _handlePadClick(e: MouseEvent): void { - const val = (e.currentTarget! as any).value; - if (this._input) { - this._input.value = val === "clear" ? "" : this._input!.value + val; - } + setProtectedAlarmControlPanelMode(this, this.hass!, this._stateObj!, mode); } private _handleAction(ev: ActionHandlerEvent) { handleAction(this, this.hass!, this._config!, ev.detail.action!); } - private get _hasCode(): boolean { - const stateObj = this._stateObj; - if (!stateObj) return false; - return hasCode(stateObj) && Boolean(this._config?.show_keypad); - } - protected render() { if (!this.hass || !this._config || !this._config.entity) { return nothing; @@ -169,8 +104,8 @@ export class AlarmControlPanelCard const actions: ActionButtonType[] = this._config.states && this._config.states.length > 0 ? isDisarmed(stateObj) - ? this._config.states.map((state) => ({ state })) - : [{ state: "disarmed" }] + ? this._config.states.map((state) => ({ mode: state })) + : [{ mode: "disarmed" }] : []; const isActionEnabled = isActionsAvailable(stateObj); @@ -202,10 +137,10 @@ export class AlarmControlPanelCard ${actions.map( (action) => html` this._onTap(e, action.state)} + @click=${(e) => this._onTap(e, action.mode)} .disabled=${!isActionEnabled} > - + ` @@ -214,44 +149,6 @@ export class AlarmControlPanelCard ` : nothing} - ${!this._hasCode - ? nothing - : html` - - `} - ${!(this._hasCode && stateObj.attributes.code_format === "number") - ? nothing - : html` -
- ${BUTTONS.map((value) => - value === "" - ? html`` - : html` - - ${value === "clear" - ? this.hass!.localize( - `ui.card.alarm_control_panel.clear_code` - ) - : value} - - ` - )} -
- `} `; } @@ -287,31 +184,9 @@ export class AlarmControlPanelCard mushroom-state-item { cursor: pointer; } - .alert { - --main-color: var(--warning-color); - } mushroom-shape-icon.pulse { --shape-animation: 1s ease 0s infinite normal none running pulse; } - mushroom-textfield { - display: block; - margin: 8px auto; - max-width: 150px; - text-align: center; - } - #keypad { - display: flex; - justify-content: center; - flex-wrap: wrap; - margin: auto; - width: 100%; - max-width: 300px; - } - #keypad mwc-button { - padding: 8px; - width: 30%; - box-sizing: border-box; - } `, ]; } diff --git a/src/ha/data/alarm_control_panel.ts b/src/ha/data/alarm_control_panel.ts new file mode 100644 index 000000000..064ba936a --- /dev/null +++ b/src/ha/data/alarm_control_panel.ts @@ -0,0 +1,112 @@ +import { HassEntityAttributeBase, HassEntityBase } from "home-assistant-js-websocket"; +import { HomeAssistant } from "../types"; +import { getExtendedEntityRegistryEntry } from "./entity_registry"; + +export const enum AlarmControlPanelEntityFeature { + ARM_HOME = 1, + ARM_AWAY = 2, + ARM_NIGHT = 4, + TRIGGER = 8, + ARM_CUSTOM_BYPASS = 16, + ARM_VACATION = 32, +} + +export type AlarmMode = + | "armed_home" + | "armed_away" + | "armed_night" + | "armed_vacation" + | "armed_custom_bypass" + | "disarmed"; + +interface AlarmControlPanelEntityAttributes extends HassEntityAttributeBase { + code_format?: "text" | "number"; + changed_by?: string | null; + code_arm_required?: boolean; +} + +export interface AlarmControlPanelEntity extends HassEntityBase { + attributes: AlarmControlPanelEntityAttributes; +} + +type AlarmConfig = { + service: string; + feature?: AlarmControlPanelEntityFeature; + icon: string; +}; + +export const ALARM_MODES: Record = { + armed_home: { + feature: AlarmControlPanelEntityFeature.ARM_HOME, + service: "alarm_arm_home", + icon: "mdi:home", + }, + armed_away: { + feature: AlarmControlPanelEntityFeature.ARM_AWAY, + service: "alarm_arm_away", + icon: "mdi:lock", + }, + armed_night: { + feature: AlarmControlPanelEntityFeature.ARM_NIGHT, + service: "alarm_arm_night", + icon: "mdi:moon-waning-crescent", + }, + armed_vacation: { + feature: AlarmControlPanelEntityFeature.ARM_VACATION, + service: "alarm_arm_vacation", + icon: "mdi:air-plane", + }, + armed_custom_bypass: { + feature: AlarmControlPanelEntityFeature.ARM_CUSTOM_BYPASS, + service: "alarm_arm_custom_bypass", + icon: "mdi:shield", + }, + disarmed: { + service: "alarm_disarm", + icon: "mdi:shield-off", + }, +}; + +export const setProtectedAlarmControlPanelMode = async ( + element: HTMLElement, + hass: HomeAssistant, + stateObj: AlarmControlPanelEntity, + mode: AlarmMode +) => { + const { service } = ALARM_MODES[mode]; + + let code: string | undefined; + + if ( + (mode !== "disarmed" && stateObj.attributes.code_arm_required) || + (mode === "disarmed" && stateObj.attributes.code_format) + ) { + const entry = await getExtendedEntityRegistryEntry(hass, stateObj.entity_id).catch( + () => undefined + ); + const defaultCode = entry?.options?.alarm_control_panel?.default_code; + + if (!defaultCode) { + const disarm = mode === "disarmed"; + + const helpers = await (window as any).loadCardHelpers(); + + const response = await helpers.showEnterCodeDialog(element, { + codeFormat: stateObj.attributes.code_format, + title: hass.localize(`ui.card.alarm_control_panel.${disarm ? "disarm" : "arm"}`), + submitText: hass.localize( + `ui.card.alarm_control_panel.${disarm ? "disarm" : "arm"}` + ), + }); + if (response == null) { + throw new Error("Code dialog closed"); + } + code = response; + } + } + + await hass.callService("alarm_control_panel", service, { + entity_id: stateObj.entity_id, + code, + }); +}; diff --git a/src/ha/data/entity_registry.ts b/src/ha/data/entity_registry.ts index ae2427c2c..3b6ce5c32 100644 --- a/src/ha/data/entity_registry.ts +++ b/src/ha/data/entity_registry.ts @@ -99,9 +99,14 @@ export interface SwitchAsXEntityOptions { entity_id: string; } +export interface AlarmControlPanelEntityOptions { + default_code?: string | null; +} + export interface EntityRegistryOptions { number?: NumberEntityOptions; sensor?: SensorEntityOptions; + alarm_control_panel?: AlarmControlPanelEntityOptions; lock?: LockEntityOptions; weather?: WeatherEntityOptions; light?: LightEntityOptions; diff --git a/src/translations/ar.json b/src/translations/ar.json index 21ad50015..c2e6b1135 100644 --- a/src/translations/ar.json +++ b/src/translations/ar.json @@ -69,9 +69,6 @@ "show_buttons_control": "أزرار التحكم؟", "show_position_control": "التحكم في الموقع؟" }, - "alarm_control_panel": { - "show_keypad": "إظهار لوحة المفاتيح" - }, "template": { "primary": "المعلومات الأساسية", "secondary": "المعلومات الثانوية", diff --git a/src/translations/bg.json b/src/translations/bg.json index cb8f202a0..1613a6001 100644 --- a/src/translations/bg.json +++ b/src/translations/bg.json @@ -70,9 +70,6 @@ "show_position_control": "Контрол на позицията?", "show_tilt_position_control": "Контрол на наклона?" }, - "alarm_control_panel": { - "show_keypad": "Покажи клавиатура" - }, "template": { "primary": "Първостепенна информация", "secondary": "Второстепенна информация", @@ -163,4 +160,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/translations/ca.json b/src/translations/ca.json index 79956a643..e070f9ebc 100644 --- a/src/translations/ca.json +++ b/src/translations/ca.json @@ -70,9 +70,6 @@ "show_position_control": "Control de posició?", "show_tilt_position_control": "Control d'inclinació?" }, - "alarm_control_panel": { - "show_keypad": "Mostra el teclat" - }, "template": { "primary": "Informació primaria", "secondary": "Informació secundaria", diff --git a/src/translations/cs.json b/src/translations/cs.json index 7e6e5bf62..60d4eb818 100644 --- a/src/translations/cs.json +++ b/src/translations/cs.json @@ -70,9 +70,6 @@ "show_position_control": "Zobrazit ovládání polohy?", "show_tilt_position_control": "Zobrazit ovládání náklonu?" }, - "alarm_control_panel": { - "show_keypad": "Zobrazit klávesnici" - }, "template": { "primary": "Základní informace", "secondary": "Sekundární informace", @@ -177,4 +174,4 @@ "card": { "not_found": "Entita nebyla nalezena" } -} \ No newline at end of file +} diff --git a/src/translations/da.json b/src/translations/da.json index f7b506732..b9a263d81 100644 --- a/src/translations/da.json +++ b/src/translations/da.json @@ -69,9 +69,6 @@ "show_buttons_control": "Betjeningsknapper?", "show_position_control": "Positionskontrol?" }, - "alarm_control_panel": { - "show_keypad": "Vis tastatur" - }, "template": { "primary": "Primær information", "secondary": "Sekundær information", diff --git a/src/translations/de.json b/src/translations/de.json index c52d2963a..135f4d81b 100644 --- a/src/translations/de.json +++ b/src/translations/de.json @@ -70,9 +70,6 @@ "show_position_control": "Positionssteuerung?", "show_tilt_position_control": "Winkelsteuerung?" }, - "alarm_control_panel": { - "show_keypad": "Keypad anzeigen" - }, "template": { "primary": "Primäre Information", "secondary": "Sekundäre Information", diff --git a/src/translations/en.json b/src/translations/en.json index da549f595..a48d12630 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -70,9 +70,6 @@ "show_position_control": "Position control?", "show_tilt_position_control": "Tilt control?" }, - "alarm_control_panel": { - "show_keypad": "Show keypad" - }, "template": { "primary": "Primary information", "secondary": "Secondary information", diff --git a/src/translations/es.json b/src/translations/es.json index c8d034cef..ff6d206f8 100644 --- a/src/translations/es.json +++ b/src/translations/es.json @@ -70,9 +70,6 @@ "show_position_control": "¿Control de posición?", "show_tilt_position_control": "¿Control de inclinación?" }, - "alarm_control_panel": { - "show_keypad": "Mostrar teclado" - }, "template": { "primary": "Información primaria", "secondary": "Información secundaria", @@ -102,8 +99,8 @@ "vacuum": { "commands": "Comandos", "commands_list": { - "on_off": "Activar/desactivar" - } + "on_off": "Activar/desactivar" + } }, "media-player": { "use_media_info": "Usar información multimedia", diff --git a/src/translations/fi.json b/src/translations/fi.json index bcd82d186..c9db11267 100644 --- a/src/translations/fi.json +++ b/src/translations/fi.json @@ -69,9 +69,6 @@ "show_buttons_control": "Toimintopainikkeet?", "show_position_control": "Sijainnin hallinta?" }, - "alarm_control_panel": { - "show_keypad": "Näytä näppäimet" - }, "template": { "primary": "Ensisijaiset tiedot", "secondary": "Toissijaiset tiedot", diff --git a/src/translations/fr.json b/src/translations/fr.json index fe280ff81..014699e3d 100644 --- a/src/translations/fr.json +++ b/src/translations/fr.json @@ -69,9 +69,6 @@ "show_buttons_control": "Contrôle avec boutons ?", "show_position_control": "Contrôle de la position ?" }, - "alarm_control_panel": { - "show_keypad": "Afficher le clavier" - }, "template": { "primary": "Information principale", "secondary": "Information secondaire", diff --git a/src/translations/he.json b/src/translations/he.json index e4dc80ef9..bf09e8ea0 100644 --- a/src/translations/he.json +++ b/src/translations/he.json @@ -60,9 +60,6 @@ "show_buttons_control": "הצג כפתורי שליטה", "show_position_control": "הצג פקדי מיקום" }, - "alarm_control_panel": { - "show_keypad": "הצג מקלדת" - }, "template": { "primary": "מידע ראשי", "secondary": "מידע מישני", @@ -144,4 +141,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/translations/hu.json b/src/translations/hu.json index d3f565920..e4842d62b 100644 --- a/src/translations/hu.json +++ b/src/translations/hu.json @@ -70,9 +70,6 @@ "show_position_control": "Pozíció vezérlő", "show_tilt_position_control": "Dőlésszög szabályzó" }, - "alarm_control_panel": { - "show_keypad": "Billentyűzet mutatása" - }, "template": { "primary": "Elsődleges információ", "secondary": "Másodlagos információ", diff --git a/src/translations/id.json b/src/translations/id.json index f4869a9d8..ab8698ed6 100644 --- a/src/translations/id.json +++ b/src/translations/id.json @@ -70,9 +70,6 @@ "show_position_control": "Kontrol posisi?", "show_tilt_position_control": "Kontrol kemiringan?" }, - "alarm_control_panel": { - "show_keypad": "Tampilkan papan tombol" - }, "template": { "primary": "Informasi primer", "secondary": "Informasi sekunder", diff --git a/src/translations/it.json b/src/translations/it.json index f68fae6a8..c9fffd9bd 100644 --- a/src/translations/it.json +++ b/src/translations/it.json @@ -70,9 +70,6 @@ "show_position_control": "Controllo percentuale apertura", "show_tilt_position_control": "Controllo percentuale inclinazione" }, - "alarm_control_panel": { - "show_keypad": "Mostra il tastierino numerico" - }, "template": { "primary": "Informazione primaria", "secondary": "Informazione secondaria", diff --git a/src/translations/ko-KR.json b/src/translations/ko-KR.json index fad7118f7..4f82938a8 100644 --- a/src/translations/ko-KR.json +++ b/src/translations/ko-KR.json @@ -1,168 +1,165 @@ { - "editor": { - "form": { - "color_picker": { - "values": { - "default": "기본 색" - } - }, - "info_picker": { - "values": { - "default": "기본 정보", - "name": "이름", - "state": "상태", - "last-changed": "마지막 변경", - "last-updated": "마지막 업데이트", - "none": "없음" - } - }, - "icon_type_picker": { - "values": { - "default": "기본 타입", - "icon": "아이콘", - "entity-picture": "엔티티 사진", - "none": "없음" - } - }, - "layout_picker": { - "values": { - "default": "기본 레이아웃", - "vertical": "수직 레이아웃", - "horizontal": "수평 레이아웃" - } - }, - "alignment_picker": { - "values": { - "default": "기본 정렬", - "start": "시작", - "end": "끝", - "center": "중앙", - "justify": "행 정렬" - } - } - }, - "card": { - "generic": { - "icon_color": "아이콘 색", - "layout": "레이아웃", - "fill_container": "콘테이너 채우기", - "primary_info": "기본 정보", - "secondary_info": "보조 정보", - "icon_type": "아이콘 타입", - "content_info": "내용 정보", - "use_entity_picture": "엔티티 사진 사용", - "collapsible_controls": "꺼져있을 때 컨트롤 접기", - "icon_animation": "활성화 시 아이콘 애니메이션 사용" - }, - "light": { - "show_brightness_control": "밝기 컨트롤 표시", - "use_light_color": "조명 색 사용", - "show_color_temp_control": "색 온도 컨트롤 표시", - "show_color_control": "색 컨트롤 표시", - "incompatible_controls": "조명이 기능을 지원하지 않는 경우 일부 컨트롤이 표시되지 않을 수 있습니다." - }, - "fan": { - "show_percentage_control": "퍼센트 컨트롤", - "show_oscillate_control": "오실레이트 컨트롤" - }, - "cover": { - "show_buttons_control": "컨트롤 버튼 표시", - "show_position_control": "위치 컨트롤 표시", - "show_tilt_position_control": "기울기 컨트롤 표시" - }, - "alarm_control_panel": { - "show_keypad": "키패드 표시" - }, - "template": { - "primary": "기본 정보", - "secondary": "보조 정보", - "multiline_secondary": "Multiline secondary?", - "entity_extra": "템플릿 및 작업에 사용", - "content": "내용", - "badge_icon": "뱃지 아이콘", - "badge_color": "뱃지 색", - "picture": "그림 (아이콘 대체)" - }, - "title": { - "title": "제목", - "subtitle": "부제목", - "title_tap_action": "제목 탭 액션", - "subtitle_tap_action": "부제목 탭 액션" - }, - "chips": { - "alignment": "정렬" - }, - "weather": { - "show_conditions": "조건 표시", - "show_temperature": "온도 표시" - }, - "update": { - "show_buttons_control": "컨트롤 버튼 표시" - }, - "vacuum": { - "commands": "명령어", - "commands_list": { - "on_off": "켜기/끄기" - } - }, - "media-player": { - "use_media_info": "미디어 정보 사용", - "use_media_artwork": "미디어 아트워크 사용", - "show_volume_level": "볼륨 레벨 표시", - "media_controls": "미디어 컨트롤", - "media_controls_list": { - "on_off": "켜기/끄기", - "shuffle": "섞기", - "previous": "이전 트랙", - "play_pause_stop": "재생/일시 정지/정지", - "next": "다음 트랙", - "repeat": "반복 모드" - }, - "volume_controls": "볼륨 컨트롤", - "volume_controls_list": { - "volume_buttons": "볼륨 버튼", - "volume_set": "볼륨 레벨", - "volume_mute": "음소거" - } - }, - "lock": { - "lock": "잠금", - "unlock": "잠금 해제", - "open": "열기" - }, - "humidifier": { - "show_target_humidity_control": "습도 조절 표시" - }, - "climate": { - "show_temperature_control": "온도 조절 표시", - "hvac_modes": "HVAC 모드" - } - }, - "chip": { - "sub_element_editor": { - "title": "칩 에디터" - }, - "conditional": { - "chip": "칩" - }, - "chip-picker": { - "chips": "칩", - "add": "칩 추가", - "edit": "수정", - "clear": "클리어", - "select": "칩 선택", - "types": { - "action": "액션", - "alarm-control-panel": "알람", - "back": "이전", - "conditional": "Conditional", - "entity": "엔티티", - "light": "조명", - "menu": "메뉴", - "template": "템플릿", - "weather": "날씨" - } - } - } - } + "editor": { + "form": { + "color_picker": { + "values": { + "default": "기본 색" + } + }, + "info_picker": { + "values": { + "default": "기본 정보", + "name": "이름", + "state": "상태", + "last-changed": "마지막 변경", + "last-updated": "마지막 업데이트", + "none": "없음" + } + }, + "icon_type_picker": { + "values": { + "default": "기본 타입", + "icon": "아이콘", + "entity-picture": "엔티티 사진", + "none": "없음" + } + }, + "layout_picker": { + "values": { + "default": "기본 레이아웃", + "vertical": "수직 레이아웃", + "horizontal": "수평 레이아웃" + } + }, + "alignment_picker": { + "values": { + "default": "기본 정렬", + "start": "시작", + "end": "끝", + "center": "중앙", + "justify": "행 정렬" + } + } + }, + "card": { + "generic": { + "icon_color": "아이콘 색", + "layout": "레이아웃", + "fill_container": "콘테이너 채우기", + "primary_info": "기본 정보", + "secondary_info": "보조 정보", + "icon_type": "아이콘 타입", + "content_info": "내용 정보", + "use_entity_picture": "엔티티 사진 사용", + "collapsible_controls": "꺼져있을 때 컨트롤 접기", + "icon_animation": "활성화 시 아이콘 애니메이션 사용" + }, + "light": { + "show_brightness_control": "밝기 컨트롤 표시", + "use_light_color": "조명 색 사용", + "show_color_temp_control": "색 온도 컨트롤 표시", + "show_color_control": "색 컨트롤 표시", + "incompatible_controls": "조명이 기능을 지원하지 않는 경우 일부 컨트롤이 표시되지 않을 수 있습니다." + }, + "fan": { + "show_percentage_control": "퍼센트 컨트롤", + "show_oscillate_control": "오실레이트 컨트롤" + }, + "cover": { + "show_buttons_control": "컨트롤 버튼 표시", + "show_position_control": "위치 컨트롤 표시", + "show_tilt_position_control": "기울기 컨트롤 표시" + }, + "template": { + "primary": "기본 정보", + "secondary": "보조 정보", + "multiline_secondary": "Multiline secondary?", + "entity_extra": "템플릿 및 작업에 사용", + "content": "내용", + "badge_icon": "뱃지 아이콘", + "badge_color": "뱃지 색", + "picture": "그림 (아이콘 대체)" + }, + "title": { + "title": "제목", + "subtitle": "부제목", + "title_tap_action": "제목 탭 액션", + "subtitle_tap_action": "부제목 탭 액션" + }, + "chips": { + "alignment": "정렬" + }, + "weather": { + "show_conditions": "조건 표시", + "show_temperature": "온도 표시" + }, + "update": { + "show_buttons_control": "컨트롤 버튼 표시" + }, + "vacuum": { + "commands": "명령어", + "commands_list": { + "on_off": "켜기/끄기" + } + }, + "media-player": { + "use_media_info": "미디어 정보 사용", + "use_media_artwork": "미디어 아트워크 사용", + "show_volume_level": "볼륨 레벨 표시", + "media_controls": "미디어 컨트롤", + "media_controls_list": { + "on_off": "켜기/끄기", + "shuffle": "섞기", + "previous": "이전 트랙", + "play_pause_stop": "재생/일시 정지/정지", + "next": "다음 트랙", + "repeat": "반복 모드" + }, + "volume_controls": "볼륨 컨트롤", + "volume_controls_list": { + "volume_buttons": "볼륨 버튼", + "volume_set": "볼륨 레벨", + "volume_mute": "음소거" + } + }, + "lock": { + "lock": "잠금", + "unlock": "잠금 해제", + "open": "열기" + }, + "humidifier": { + "show_target_humidity_control": "습도 조절 표시" + }, + "climate": { + "show_temperature_control": "온도 조절 표시", + "hvac_modes": "HVAC 모드" + } + }, + "chip": { + "sub_element_editor": { + "title": "칩 에디터" + }, + "conditional": { + "chip": "칩" + }, + "chip-picker": { + "chips": "칩", + "add": "칩 추가", + "edit": "수정", + "clear": "클리어", + "select": "칩 선택", + "types": { + "action": "액션", + "alarm-control-panel": "알람", + "back": "이전", + "conditional": "Conditional", + "entity": "엔티티", + "light": "조명", + "menu": "메뉴", + "template": "템플릿", + "weather": "날씨" + } + } + } + } } diff --git a/src/translations/nl.json b/src/translations/nl.json index 842aa4c79..64fb3dd74 100644 --- a/src/translations/nl.json +++ b/src/translations/nl.json @@ -70,9 +70,6 @@ "show_position_control": "Toon positie bediening", "show_tilt_position_control": "Toon tilt control" }, - "alarm_control_panel": { - "show_keypad": "Toon toetsenbord" - }, "template": { "primary": "Primaire informatie", "secondary": "Secundaire informatie", diff --git a/src/translations/pl.json b/src/translations/pl.json index b03bc552e..6acee1df5 100644 --- a/src/translations/pl.json +++ b/src/translations/pl.json @@ -70,9 +70,6 @@ "show_position_control": "Sterowanie położeniem?", "show_tilt_position_control": "Sterowanie poziomem otwarcia?" }, - "alarm_control_panel": { - "show_keypad": "Wyświetl klawiaturę" - }, "template": { "primary": "Informacje główne", "secondary": "Informacje drugorzędne", @@ -154,7 +151,7 @@ "entity": "Encja", "light": "Światło", "menu": "Menu", - "spacer": "Odstęp", + "spacer": "Odstęp", "template": "Szablon", "weather": "Pogoda" } diff --git a/src/translations/ro.json b/src/translations/ro.json index ac43b4de2..1d737c405 100644 --- a/src/translations/ro.json +++ b/src/translations/ro.json @@ -70,9 +70,6 @@ "show_position_control": "Comandă pentru poziție?", "show_tilt_position_control": "Comandă pentru înclinare?" }, - "alarm_control_panel": { - "show_keypad": "Arată tastatura" - }, "template": { "primary": "Informație principală", "secondary": "Informație secundară", diff --git a/src/translations/ru.json b/src/translations/ru.json index 5671585dc..685269644 100644 --- a/src/translations/ru.json +++ b/src/translations/ru.json @@ -70,9 +70,6 @@ "show_position_control": "Управлять позицией?", "show_tilt_position_control": "Управлять наклоном?" }, - "alarm_control_panel": { - "show_keypad": "Показ клавиатуры" - }, "template": { "primary": "Основная информация", "secondary": "Второстепенная информация", diff --git a/src/translations/sk.json b/src/translations/sk.json index 6fd999dc6..cd636ee49 100644 --- a/src/translations/sk.json +++ b/src/translations/sk.json @@ -70,9 +70,6 @@ "show_position_control": "Ovládanie pozície?", "show_tilt_position_control": "Ovládanie natočenia?" }, - "alarm_control_panel": { - "show_keypad": "Zobraziť klávesnicu" - }, "template": { "primary": "Základné info", "secondary": "Doplnkové info", @@ -144,7 +141,7 @@ "slider": "Posúvač", "buttons": "Tlačidlá" } - } + } }, "chip": { "sub_element_editor": { @@ -167,7 +164,7 @@ "entity": "Entita", "light": "Svetlo", "menu": "Menu", - "spacer": "Medzera", + "spacer": "Medzera", "template": "Šablóna", "weather": "Počasie" } diff --git a/src/translations/sl.json b/src/translations/sl.json index b59599904..da29fc7f8 100644 --- a/src/translations/sl.json +++ b/src/translations/sl.json @@ -70,9 +70,6 @@ "show_position_control": "Nadzor položaja?", "show_tilt_position_control": "Nadzor nagiba?" }, - "alarm_control_panel": { - "show_keypad": "Prikaži tipkovnico" - }, "template": { "primary": "Primarna informacija", "secondary": "Sekundarna informacija", @@ -177,4 +174,4 @@ "card": { "not_found": "Entiteta ni najdena" } -} \ No newline at end of file +} diff --git a/src/translations/uk.json b/src/translations/uk.json index b8b92297d..533c7bd28 100644 --- a/src/translations/uk.json +++ b/src/translations/uk.json @@ -70,9 +70,6 @@ "show_position_control": "Керування позицією?", "show_tilt_position_control": "Керування нахилом?" }, - "alarm_control_panel": { - "show_keypad": "Показати клавіатуру" - }, "template": { "primary": "Головна інформація", "secondary": "Додаткова інформаіця", diff --git a/src/translations/vi.json b/src/translations/vi.json index 7d38fcd9e..7849778bb 100644 --- a/src/translations/vi.json +++ b/src/translations/vi.json @@ -70,9 +70,6 @@ "show_position_control": "Điều khiển vị trí?", "show_tilt_position_control": "Điều khiển độ nghiêng?" }, - "alarm_control_panel": { - "show_keypad": "Hiện bàn phím" - }, "template": { "primary": "Thông tin chính", "secondary": "Thông tin phụ", diff --git a/src/translations/zh-Hans.json b/src/translations/zh-Hans.json index c21379ff9..3b79e5de8 100644 --- a/src/translations/zh-Hans.json +++ b/src/translations/zh-Hans.json @@ -70,9 +70,6 @@ "show_position_control": "位置控制?", "show_tilt_position_control": "角度控制?" }, - "alarm_control_panel": { - "show_keypad": "显示键盘" - }, "template": { "primary": "首要信息", "secondary": "次要信息", diff --git a/src/translations/zh-Hant.json b/src/translations/zh-Hant.json index 93f5fc066..a00d754c1 100644 --- a/src/translations/zh-Hant.json +++ b/src/translations/zh-Hant.json @@ -70,9 +70,6 @@ "show_position_control": "位置控制?", "show_tilt_position_control": "角度控制?" }, - "alarm_control_panel": { - "show_keypad": "顯示鍵盤" - }, "template": { "primary": "主要訊息", "secondary": "次要訊息", @@ -144,7 +141,7 @@ "slider": "滑桿", "buttons": "按鈕" } - } + } }, "chip": { "sub_element_editor": { diff --git a/src/utils/icons/alarm-panel-icon.ts b/src/utils/icons/alarm-panel-icon.ts deleted file mode 100644 index 803ffbb4f..000000000 --- a/src/utils/icons/alarm-panel-icon.ts +++ /dev/null @@ -1,18 +0,0 @@ -export const alarmPanelIconAction = (state?: string) => { - switch (state) { - case "armed_away": - return "mdi:shield-lock-outline"; - case "armed_vacation": - return "mdi:shield-airplane-outline"; - case "armed_home": - return "mdi:shield-home-outline"; - case "armed_night": - return "mdi:shield-moon-outline"; - case "armed_custom_bypass": - return "mdi:shield-half-full"; - case "disarmed": - return "mdi:shield-off-outline"; - default: - return "mdi:shield-outline"; - } -};