custom-cards / button-card

❇️ Lovelace button-card for home assistant
MIT License
1.93k stars 233 forks source link

`group_expand` only works with old style groups #645

Closed bdr99 closed 1 year ago

bdr99 commented 1 year ago

Checklist

Describe the bug The group_expand property seems to only work with groups defined as old style groups (entity ID begins with group.). Is there a way to make it work with groups defined via the new Helpers UI-based configuration? The entity ID of my group begins with light..

Version of the card Version: 3.4.2

To Reproduce This is the configuration I used:

  - type: custom:button-card
    name: First Floor Lights
    entity: light.first_floor_lights # This is a light group containing 8 lights
    icon: mdi:home-floor-1
    group_expand: true
    custom_fields:
      group_count: |
        [[[
          const entityIds = entity.attributes.entity_id;
          let countOn = 0;
          let countTotal = entityIds.length;
          for (const entityId of entityIds) {
            var state = states[entityId].state;
            if (state == "on") countOn += 1;
          }
          return countOn + "/" + countTotal;
        ]]]

Screenshots N/A

Expected behavior Expect custom field to update when the state of any of the entities in the group changes.

Desktop (please complete the following information): Firefox 108 on Windows 11

Smartphone (please complete the following information): N/A

Additional context N/A

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 4.0.0-dev.14 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 4.0.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

bdr99 commented 1 year ago

@RomRider Thanks for fixing this!