From 93f92cb94265b7e648559aa8d858f0b0b896bf9f Mon Sep 17 00:00:00 2001 From: RFDarter Date: Fri, 7 Jun 2024 22:30:07 +0200 Subject: [PATCH 1/2] v3 support datetime-datetime (#103) --- packages/v3/src/esp-entity-table.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/v3/src/esp-entity-table.ts b/packages/v3/src/esp-entity-table.ts index 3b31e5b..4bc224b 100644 --- a/packages/v3/src/esp-entity-table.ts +++ b/packages/v3/src/esp-entity-table.ts @@ -302,7 +302,7 @@ class ActionRenderer { const val = (e.target)?.value; this.actioner?.restAction( entity, - `${action}?${opt}=${val}` + `${action}?${opt}=${val.replace('T', ' ')}` ); }}" /> @@ -481,6 +481,19 @@ class ActionRenderer { `; } + render_datetime() { + if (!this.entity) return; + return html` + ${this._datetime( + this.entity, + "datetime-local", + "set", + "value", + this.entity.value, + )} + `; + } + render_switch() { if (!this.entity) return; if (this.entity.assumed_state) From f264a22ec1d4065b7bd02ad834ea5483a5d90165 Mon Sep 17 00:00:00 2001 From: RFDarter Date: Fri, 7 Jun 2024 22:30:24 +0200 Subject: [PATCH 2/2] v2 support datetime-datetime (#104) --- packages/v2/src/esp-entity-table.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/v2/src/esp-entity-table.ts b/packages/v2/src/esp-entity-table.ts index 6191030..9cc1a30 100644 --- a/packages/v2/src/esp-entity-table.ts +++ b/packages/v2/src/esp-entity-table.ts @@ -302,7 +302,7 @@ class ActionRenderer { const val = (e.target)?.value; this.actioner?.restAction( entity, - `${action}?${opt}=${val}` + `${action}?${opt}=${val.replace('T', ' ')}` ); }}" /> @@ -460,6 +460,19 @@ class ActionRenderer { `; } + render_datetime() { + if (!this.entity) return; + return html` + ${this._datetime( + this.entity, + "datetime-local", + "set", + "value", + this.entity.value, + )} + `; + } + render_text() { if (!this.entity) return; return this._textinput(