thomasloven / hass-browser_mod

🔹 A Home Assistant integration to turn your browser into a controllable entity and media player
MIT License
1.3k stars 186 forks source link

Launching popup within a popup doesn't work #632

Open sagaland93 opened 1 year ago

sagaland93 commented 1 year ago

My Home Assistant version: 2023.8.4

browser_mod popups have been acting different since 2023.8.2

I'm creating a popup and trying to create a new one from within the first. Usually the first popup closes and the new one appears, now nothing happens.

Steps to reproduce:

# From the lovelace dashboard
- type: custom:button-card
  entity: sensor.living_room_active
  name: Living
  tap_action:
    !include popup/living_room.yaml

# living_room.yaml launches a popup with fire-dom-event
# then, from within the same yaml, I create a grid with buttons, like the one below:
- type: custom:button-card
  entity: light.ecodim_dimmer_living_room_downlights
  name: Spots
  template:
    - light

# light template:
light:
  template:
    - base
    - circle
    - loader
  variables:
    circle_input: >
      [[[
        if (entity) {
            // if light group get brightness from child to remove bounce
            let child = entity.attributes.entity_id,
                brightness = child && states[child[0]].attributes.brightness
                    ? Math.round(states[child[0]].attributes.brightness / 2.54)
                    : Math.round(entity.attributes.brightness / 2.54);
            return brightness === 0 && entity.state !== 'off'
                ? 1
                : brightness
        }
      ]]]
    circle_input_unit: '%'
    light_entity: '[[[ return entity.entity_id ]]]'
  double_tap_action:
    action: fire-dom-event
    browser_mod:
      service: browser_mod.popup
      data:
        sequence:
        style: >
          --popup-background-color: transparent;
        content:
          type: custom:more-info-card
          entity: '[[[ return variables.light_entity; ]]]'
        card_mod:
          style:
            more-info-card:
              $ha-card:
                .: |
                  state-card-content {
                    display: none !important;
                  }
                $: |
                  .card-header {
                    display: none !important;
                  }
                more-info-light:
                  $: |
                    ha-attributes {
                      display: none !important;
                    }
                    .controls {
                      margin-bottom: 0 !important;
                    }

By replacing the space in the checkboxes ([ ]) with an X below, I indicate that I:

jfeltges commented 11 months ago

I don't think any of the tap actions are working at all. At least in my config, which I largely copied from yours.