Add more info alarm control panel (#15893)

* Add more info alarm control panel

* Improve buttons sizes

* Add triggered, arming and pending state

* Add keypad

* Improve alarm code dialog

* Fix code condition

* Clean code

* Fix mode selection with code

* Use nothing
This commit is contained in:
Paul Bottein
2023-03-28 16:31:25 +02:00
committed by GitHub
parent 3a700aebcc
commit 48c74c8660
10 changed files with 671 additions and 184 deletions

View File

@@ -100,10 +100,11 @@ export class HaControlSelect extends LitElement {
private _handleKeydown(ev: KeyboardEvent) {
if (!this.options || this._activeIndex == null || this.disabled) return;
const value = this.options[this._activeIndex].value;
switch (ev.key) {
case " ":
this.value = this.options[this._activeIndex].value;
fireEvent(this, "value-changed", { value: this.value });
this.value = value;
fireEvent(this, "value-changed", { value });
break;
case "ArrowUp":
case "ArrowLeft":
@@ -132,7 +133,7 @@ export class HaControlSelect extends LitElement {
if (this.disabled) return;
const value = (ev.target as any).value;
this.value = value;
fireEvent(this, "value-changed", { value: this.value });
fireEvent(this, "value-changed", { value });
}
private _handleOptionMouseDown(ev: MouseEvent) {