From 33e4ad5811ded40214f2252b1803116e8777cfb3 Mon Sep 17 00:00:00 2001 From: Darkdragon14 Date: Sat, 23 Nov 2024 17:49:21 +0100 Subject: [PATCH 1/4] feat(choose-now-orstart date): add input to choose between now and a start date --- .../ha_guest_mode/www/ha-guest-mode.js | 62 ++++++++++--------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/custom_components/ha_guest_mode/www/ha-guest-mode.js b/custom_components/ha_guest_mode/www/ha-guest-mode.js index a0e0adf..7783f63 100644 --- a/custom_components/ha_guest_mode/www/ha-guest-mode.js +++ b/custom_components/ha_guest_mode/www/ha-guest-mode.js @@ -45,6 +45,7 @@ class GuestModePanel extends LitElement { users: { type: Array }, tokens: { type: Array }, alert: { type: String }, + enableStartDate: { type: Boolean }, }; } @@ -63,6 +64,7 @@ class GuestModePanel extends LitElement { this.expirationDate = getNow(); this.startDateLabel = "Start Date"; this.endDtateLabel = "Expiration Date"; + this.enableStartDate = false; } fetchUsers() { @@ -119,8 +121,8 @@ class GuestModePanel extends LitElement { this.expirationDate = e.detail.value; } - toggleSideBar() { - this.dispatchEvent(new Event('hass-toggle-menu', { bubbles: true, composed: true})); + toggleEnableStartDate(e) { + this.enableStartDate = !this.enableStartDate; } addClick() { @@ -190,14 +192,6 @@ class GuestModePanel extends LitElement {