DBuit / Homekit-panel-card

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

simplify _customAction logic and add support for a new action - "popup" #62

Closed caseyjhol closed 4 years ago

caseyjhol commented 4 years ago

Adds support for setting the action to "popup" and streamlines the logic in the _customAction function. Addresses #41. This allows you to use light-popup-card with tap_action out of the box.

Note: I wasn't able to use ESLint as there isn't an ESLint config file.

Example usage:

  - cards:
      - entities:
          - entities:
              - entity: cover.big_garage
                popupExtend:
                  supportedFeaturesTreshold: 8
                tap_action:
                  action: popup
              - entity: switch.porch_light
              - entity: switch.living_room_fan
            popup:
              settings: true
              supportedFeaturesTreshold: -1
              type: 'custom:light-popup-card'
DBuit commented 4 years ago

Hi @caseyjhol

Nice work! Could you also add this option in the readme? than i will merge this :)

caseyjhol commented 4 years ago

@DBuit Done!

DBuit commented 4 years ago

@caseyjhol awesome thanks!