DBuit / Homekit-panel-card

Homekit panel card for home assistant
MIT License
304 stars 54 forks source link

popupExtend not working when custom:light-pop-up-card is used on single entity #16

Closed acateon closed 4 years ago

acateon commented 4 years ago

The popup works fine with the config below, but popupExtend is ignored.

Example config:

- entity: group.all_belysning
  name: Kväll
  icon: mdi:weather-night
  popup:
    type: custom:light-popup-card
    entity: group.all_belysning
    scenesInARow: 4
    actionsInARow: 4
    brightnessWidth: 100px
    brightnessHeight: 300px
    switchWidth: 100px
    switchHeight: 300px
    supportedFeaturesTreshold: -1
  popupExtend:
    actions:
      - service: scene.turn_on
        service_data:
          entity_id: scene.ontspannen
        color: "#FDCA64"
        name: ontspannen
      - service: scene.turn_on
        service_data:
          entity_id: scene.helder
        color: "#FFE7C0"
        name: helder
      - service: scene.turn_on
        service_data:
          entity_id: scene.concentreren
        color: "#BBEEF3"
        name: concentreren
      - service: scene.turn_on
        service_data:
          entity_id: scene.energie
        color: "#8BCBDD"
        name: energie
DBuit commented 4 years ago

@acateon you don't need popup extend in your configuration because you already defined the popup on the entity. popupExtend can be used when you define the popup on a higher level and you wanna changes some configuration for a specific entity

For example, below you see the popup is not defined on a specific entity so all 3 lights entities will use the same popup with the same configuration.

entities:
          - title: Row 1
            popup:
              type: custom:light-popup-card
              scenesInARow: 2
              brightnessWidth: 130px
              brightnessHeight: 350px
              switchWidth: 110px
              switchHeight: 300px
            entities:
              - entity: light.zithoek
              - entity: light.zithoek
              - entity: light.zithoek

But if you want that 1 of the lights act different you can add the popupExtend like this:

entities:
          - title: Row 1
            popup:
              type: custom:light-popup-card
              scenesInARow: 2
              brightnessWidth: 130px
              brightnessHeight: 350px
              switchWidth: 110px
              switchHeight: 300px
            entities:
              - entity: light.zithoek
              - entity: light.zithoek
                 popupExtend:
                 actions:
                   - service: scene.turn_on
                     service_data:
                     entity_id: scene.ontspannen
                     color: "#FDCA64"
                     name: ontspannen
              - entity: light.zithoek