thomasloven / lovelace-popup-card

94 stars 14 forks source link

Switch position (light, input booleans...) and sensor icon not refreshed correctly #27

Closed Oriondely closed 5 years ago

Oriondely commented 5 years ago

Hello, first of all.. thank you for your great work !

I have a problem with popup-card in my HA, ver. 0.91.0 OS: Windows 10 Browser: Chrome

When I switch ON a light or input boolean in a popup card, the switch works correctly in HA, but it reverts back to OFF after a couple of seconds in the initial position in the popup-card.

The light icon is not showed correctly in popup-card, but it's showed correctly in glances card.

These are the steps followed (images attached): 01 - Light is OFF 02 - Turning light ON 03 - Light is ON but turns OFF automatically in the popup card after a couple of seconds (not correct) 04 - In the glance card Light is ON (correct) 05 - If I open popup card light is ON (correct)

I have the same issue also with input boolean switches. Am I doing something wrong? Thank you

This is the lovelace configuration used:

resources:
  - url: /local/card-tools/card-tools.js?v=0.4
    type: js
  - url: /local/more-info-card/more-info-card.js
    type: js
  - url: /local/popup-card/popup-card.js
    type: js    
  - url: /local/fold-entity-row/fold-entity-row.js
    type: js
  - url: /local/card-modder/card-modder.js
    type: js
  - url: /local/time-input-row/time-input-row.js
    type: js
  - url: /local/dual-gauge-card/dual-gauge-card.js
    type: js
  - url: /local/vertical-stack-in-card/vertical-stack-in-card.js?v=0.1.2
    type: js
  - url: /local/bar-card/bar-card.js?v=0.1.9.7.1
    type: js
  - url: /local/mini-graph-card-bundle/mini-graph-card-bundle.js?v=0.3.3
    type: js
  - url: /local/slider-entity-row/slider-entity-row.js
    type: js
  - url: /local/button-card/button-card.js
    type: js
  - url: /local/popup-scroll-fix/popup.js
    type: js

# popup_cards Section
views:
  - title: Zona Giorno
    icon: 'mdi:weather-sunny'
    panel: false
    path: default_view
    badges: []
    popup_cards:
      light.01_ingresso_1_corridoio:
        title: Luci 01 Ingresso
        large: true
        card:
          type: entities
          show_header_toggle: false
          entities:
            - type: custom:more-info-card
              entity: light.01_ingresso_1_corridoio
            - type: custom:more-info-card
              entity: light.01_ingresso_2_zona_giorno
            - type: custom:more-info-card
              entity: light.01_ingresso_3_zona_notte

#cards Section
    cards:
      - type: custom:vertical-stack-in-card
        title: Ingresso
        cards:
        - type: glance
          columns: 2
          show_icon: true
          show_name: false
          show_state: true
          entities:
            - entity: light.01_ingresso_1_corridoio
            - entity: input_select.ismart_alarm

01 - Light is OFF 02 - Turning Light ON 03 - Light is ON but turns OFF automatically (not correct) 04 - In the glance card Light is ON (correct) 05 - If I open popup card light is ON (correct)

thomasloven commented 5 years ago

What is popup-scroll-fix?

thomasloven commented 5 years ago

I suppose it's this: https://gist.github.com/kkckkc/3b34c0d700f3a25aee949f7768d97b46 If so, that could be what's causing this behavior. Try adding document.querySelector("home-assistant").provideHass(message); after line 32 in that.

Oriondely commented 5 years ago

Yes, exactly, it seems to work now ;) I had to do also an "empty cache and reload" in chrome to fix it. Thank you!

thomasloven commented 5 years ago

I meant to add srolling support before the rerelease, but forgot. I'll see if I can get it done in the next few days.

Oriondely commented 5 years ago

Perfect! So, if the next "lovelace-popup-card" version will have scrolling support, will be possible to disable the popup.js "scrolling feature" from resources section, isn't it? Thanks.