Skip to content

Commit

Permalink
manual sync PR 115 (#134)
Browse files Browse the repository at this point in the history
* manual sync PR 115

* prettier

* prettier

* prettier

* prettier
  • Loading branch information
ildar170975 authored Jan 28, 2025
1 parent 57533d5 commit 542eef8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/restriction-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ class RestrictionCard extends LitElement implements LovelaceCard {
}
}

private _handleRestriction(): void {
if (!this._config || !this.shadowRoot || this._delay || this._maxed) {
private async _handleRestriction(): Promise<void> {
if (!this._config || !this.shadowRoot || this._delay || this._maxed || !this._helpers) {
return;
}

Expand All @@ -193,7 +193,11 @@ class RestrictionCard extends LitElement implements LovelaceCard {
}

if (this._config.restrictions.pin && this._matchRestriction(this._config.restrictions.pin)) {
const pin = prompt(this._config.restrictions.pin.text || 'Input pin code');
const pin = await this._helpers.showEnterCodeDialog(lock, {
codeFormat: 'number',
title: this._config.restrictions.pin.text || 'Input pin code',
submitText: 'OK',
});

// tslint:disable-next-line: triple-equals
if (pin != this._config.restrictions.pin.code) {
Expand Down

0 comments on commit 542eef8

Please sign in to comment.