From 0f3bb8f3bc2d27a4272486300f20c1b776ad3d63 Mon Sep 17 00:00:00 2001 From: finity69x2 <32221243+finity69x2@users.noreply.github.com> Date: Sat, 4 Jun 2022 03:52:37 -0400 Subject: [PATCH] Revert "Update button state when target entity is a group" --- dist/light-brightness-preset-row.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/dist/light-brightness-preset-row.js b/dist/light-brightness-preset-row.js index 2052e4e..68140f8 100644 --- a/dist/light-brightness-preset-row.js +++ b/dist/light-brightness-preset-row.js @@ -122,7 +122,7 @@ class CustomLightBrightnessRow extends Polymer.Element { hassChanged(hass) { const config = this._config; - var stateObj = hass.states[config.entity]; + const stateObj = hass.states[config.entity]; const custTheme = config.customTheme; const custSetpoint = config.customSetpoints; const revButtons = config.reverseButtons; @@ -140,12 +140,7 @@ class CustomLightBrightnessRow extends Polymer.Element { const custLowTxt = config.customLowText; const custMedTxt = config.customMedText; const custHiTxt = config.customHiText; - - // if entity is a group, use the state of the 1st item in the group to read current state (e.g. current brightness) - if (stateObj && stateObj.attributes && Array.isArray(stateObj.attributes.entity_id) && stateObj.attributes.entity_id.length > 0) { - var firstChildEntity_id = stateObj.attributes.entity_id[0]; - stateObj = hass.states[firstChildEntity_id]; - } + let lowSetpoint; let medSetpoint;