thomasloven / lovelace-popup-card

94 stars 14 forks source link

Light toggles don't work after using popup card (map) #11

Closed averagecanadian closed 5 years ago

averagecanadian commented 5 years ago

I have a custom:popup-card to open up a map with my location from device_tracker. If I call that popup I am no longer able to toggle my lights. They'll only send the last command.

I've tried changing the popup-card to another type (ie entities) and my lights don't have any issues after that. As far as I can tell, it's only affected with the map type.

thomasloven commented 5 years ago

Please provide a minimal working example.

And also - please - a screenshot of your magical map with toggleable lights.

averagecanadian commented 5 years ago

Sorry, pretty new to this so I'll try to explain it better.

title: My Awesome Home
# Include external resources
resources:
  - url: /local/my-custom-card.js
    type: js
  - url: /local/my-webfont.css
    type: css
  - url: /local/plugins/card-tools.js
    type: js
  - url: /local/plugins/popup-cards.js
    type: js
  - url: /local/plugins/card-modder.js
    type: js    

# Optional background for all views. Check https://developer.mozilla.org/en-US/docs/Web/CSS/background for more examples.
background: center / cover no-repeat url("/background.png") fixed
# Exclude entities from "Unused entities" view
excluded_entities:
  - weblink.router
views:
    # View tab title.
  - title: Home
    # Unique path for direct access /lovelace/${path}
    path: example
    # Optional background (overwrites the global background).
    background: radial-gradient(crimson, skyblue)
    # Each view can have a different theme applied. Theme should be defined in the frontend.
    theme: dark-mode
    # The cards to show on this view.
    cards:      
      - type: vertical-stack
        cards:
          - type: custom:popup-card
            entity: device_tracker.google_maps_110244927439938210243
            title: Richard's Location
            card:
              type: map
              default_zoom: 15
              entities:
                - device_tracker.google_maps_110244927439938210243        
          - type: glance
            title: Locations
            entities:              
              - device_tracker.google_maps_110244927439938210243
          - type: thermostat
            entity: climate.hallway
          - type: horizontal-stack
            cards:
              - type: light
                entity: light.living_room_main_lights
                name: Living Room
              - type: light
                entity: light.dining_room_main_lights
                name: Dining Room
      - type: vertical-stack
        cards:
          - type: weather-forecast
            entity: weather.dark_sky
          - type: custom:popup-card
            entity: switch.shed
            title: Test Popup 2
            card:
              type: entities
              entities:
                - switch.shed
                - switch.dinning_room
          - type: entities
            entities:
              - switch.shed
              - switch.dinning_room

My default view 1 - default view

This shows what happens when I toggle on my living room light before I use the map pop up 2 - toggle light on normally

This shows what happens when I toggle off my living room light before I use the map pop up 3 - toggle light off normally

The entities pop up when I click on "Shed". When I close this pop up my living room light still toggles on and off as expected. 4 - entities pop up

My map pop up when I click on my icon in the Locations glance area 5 - map pop up

This is where the issue beings. I try to toggle the light on. As you can see the light doesn't turn yellow and the dimmer doesn't go to 100% 6 - toggle light on after map pop up

This is the pop up when I click on the hamburger in the top right corner. It indicates that the light is indeed on but as you can see the image is still blue and the dimmer is still at 0% 7 - notice light is on in more info box but image is still blue

iantrich commented 5 years ago

I have nothing to add that might help, but just wanted to say that THIS is how your write a bug report! Thank you!

thomasloven commented 5 years ago

Thank you! That was a very clear description.

I am unable to reproduce the problem using my development version of popup-card which I will be releasing very soon.

With a bit of luck, that should fix your problem.

I also noticed, though, that the very center of the light bulbs are not clickable (right where the brightness is displayed), so I sent in a fix for that that'll hopefully make it to Home Assistant 0.89...

thomasloven commented 5 years ago

I am also unable to reproduce this using the currently released version of popup-card.

Do you see anything in your browser console (F12 in google chrome) when going through the steps above?

averagecanadian commented 5 years ago

Thanks for the help guys.

Console catches this when I try to close the map pop up with either the "x" button or just clicking back on my main display. This same error is not thrown when I use the custom pop-up with my 'shed' example.

TypeError: this.getPane(...) is undefined

When I click on the cf5a0fe6ded85b90358ef.chunk.js it looks like this error is in the js for the actual map. Perhaps I'm in the wrong bug section :)

Map popped up, no error in console 8 - no error with popup open

Closed map by click the 'x' and error shows up in console 9 - error once i close map popup

a quick snapshot of the cf5a0fe6ded85b90358ef.chunk.js file chunkjs

thomasloven commented 5 years ago

Could you check if this is still a problem after updating card-tools to the latest version?

averagecanadian commented 5 years ago

Just checked again. It's working for me now with out issue. I did a fresh install of HA the other day cause I was having an issuing upgrading so I'm not sure if that fixed it or the updated files did but it's working without error now. Thanks for following up.

thomasloven commented 5 years ago

Could be a little of both. It's not impossible that the map in your popup card was reloaded 10 times per second before - even after closing the popup... and it would be a bigger wonder if that did NOT mess everything else up...