From 5dbaa4a9302a6b769e08ae3a421b13b2b200cd5a Mon Sep 17 00:00:00 2001 From: anatoly-savchenkov <48646998+anatoly-savchenkov@users.noreply.github.com> Date: Mon, 15 Aug 2022 01:26:22 +0300 Subject: [PATCH] Webui small fixes (#12) --- v2/esp-entity-table.ts | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/v2/esp-entity-table.ts b/v2/esp-entity-table.ts index 6b169aa..17840a8 100644 --- a/v2/esp-entity-table.ts +++ b/v2/esp-entity-table.ts @@ -104,10 +104,10 @@ export class EntityTable extends LitElement { type="${entity.mode == 1 ? "number" : "range"}" name="${entity.unique_id}" id="${entity.unique_id}" - value="${value}" step="${step}" min="${min}" max="${max}" + value="${value}" @change="${(e: Event) => { let val = e.target?.value; this.restAction(entity, `${action}?${opt}=${val}`); @@ -189,7 +189,7 @@ export class EntityTable extends LitElement { if (entity.domain === "climate") { let target_temp_slider, target_temp_label; if (entity.target_temperature_low !== undefined) { - target_temp_label= html`${entity.target_temperature_low} .. ${entity.target_temperature_high}`; + target_temp_label= html`${entity.target_temperature_low} .. ${entity.target_temperature_high}`; target_temp_slider = html` ${this.range( entity, @@ -198,8 +198,7 @@ export class EntityTable extends LitElement { entity.target_temperature_low, entity.min_temp, entity.max_temp, - entity.step, - 0 + entity.step )} ${this.range( entity, @@ -208,8 +207,7 @@ export class EntityTable extends LitElement { entity.target_temperature_high, entity.min_temp, entity.max_temp, - entity.step, - 0 + entity.step )} `; } else { @@ -222,25 +220,23 @@ export class EntityTable extends LitElement { entity.target_temperature, entity.min_temp, entity.max_temp, - entity.step, - 0 + entity.step )} `; } return html` - + ${target_temp_slider} -
+
Mode: + ${entity.modes.map( + (mode) => html` + ` + ) + } `; } return html``;