Skip to content

Commit

Permalink
Merge pull request #32 from finity69x2/revert-30-patch-1
Browse files Browse the repository at this point in the history
Revert "Update button state when target entity is a group"
  • Loading branch information
finity69x2 authored Jun 4, 2022
2 parents df6810d + 0f3bb8f commit e59a913
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions dist/light-brightness-preset-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit e59a913

Please sign in to comment.