thomasloven / lovelace-popup-card

94 stars 14 forks source link

Calling another popup within first #24

Closed mrneilix closed 5 years ago

mrneilix commented 5 years ago

Hey, so this is kinda a long shot, and probably a limitation with polymer, but would it be possible to click on an glance item from within a popup, which would call a different one? I have my device trackers in a popup, and would like to click those and see more info on that item.

In any event, great work, I use this card a ton in my Hass to clean up my front end (and got rid of a bunch of views!

Dino-Tech commented 5 years ago

@mrneilix AFAIK another more-info popup is not allowed from another already opened popup. However, using lovelace-browser-commander you can call the more-info popup from the entity you wish to open as a BC script, but the first popup would have to be closed( <-- I think, didn't try it) before the second one opened. This also is achieved with BC as a part of the same script just before the second popup opens.

Ugly and hacky, but works**:

# pop-up card
    ...
    card:
      type: entities
      entities:
        - type: 'custom:hui-glance-card'
          columns: 1
          show_state: false
          entities:
            - type: entity-button
              name: Darren
              icon: mdi:account
              tap_action:
                action: call-service
                service: script.turn_on
                service_data:
                   entity_id: script.test_more_info
              entity: person.darren

# script
test_more_info:
  sequence:
    - event: browser_command
      event_data:
        command: close-popup
    - delay: '00:00:03'
    - event: browser_command
      event_data:
        command: more-info
        entity_id: person.darren

I'm sure there is a better way...

thomasloven commented 5 years ago

That's correct. Only one layer of more-info is allowed.

Using browser-commander is indeed probably your best bet.