mattieha / slider-button-card

A button card with integrated slider
MIT License
435 stars 68 forks source link

Setting invert: false is causing some inconsistencies (state, opening issues) #75

Open barmazu opened 3 years ago

barmazu commented 3 years ago

Checklist:

Release with the issue: 1.7.0 Last working release (if known): N/A Browser and Operating System: Windows/Firefox/Chrome, Android/HA Companion App

Description of problem: When invert: false is set sliding is not working correctly and state is always render as "Closed"

So let's start from good news: when sliding within 1%-99% range everything is working and rendering correctly.

Case 1. Cover is opened (Position: 0) Issue 1. On the card cover state is misreported as "Closed". Additional information: State icon is rendered correctly ("Open"). Striped pattern is not rendered on the card (I presume this is also correct, cover is in fact open after all)

Case 2. I'm sliding (in my case from top to bottom) to close cover (from position: 0 to position: 100) Issue 2. Upon sliding down across the button stripped pattern is render correctly, but final state is render as "Open". Once closing animation is over there's no stripped pattern on the button. Additional information: Cover is physically closed, state icon is rendered correctly (as "Closed), state is reported as "Closed".

Case 3. I'm sliding (from bottom to top) to open cover (from position: 100 to position: 0) Issue 3. Upon sliding up across the button stripped pattern is render correctly, but final state is render as "Closed". After releasing nothing happens (no physical opening of the cover), no opening animation on the card either. The card is in state as described in Case 2.

Case 4. I'm sliding (from top to bottom) on closed cover (Position: 100) (The card is still in state as described in Case 2) Issue 4. Stripped pattern is rendered as you would expect (closing from top to bottom) but final state is render as "Open" and nothing happens. Button states in this pose, still no physical movement of the cover. Additional information: Sliding to top does not change much except stripped pattern is removed from card, and state is reported back as "Closed". Cover actually stays closed.

To recover Case 4 I need to slide up to 1%. Cover will be opened.

Javascript errors shown in the web inspector (if applicable):

N/A

Additional information:

mattieha commented 3 years ago

@barmazu Could u please provide the attributes of the cover: For example

current_position: 14
friendly_name: Living cover
supported_features: 7
device_class: blind
barmazu commented 3 years ago

Hi @mattieha, To be more precise to recover from Case 4. I need to set slide up to any value except of 0%. So doing slide to, say, 74% will open cover a little bit, then I can go to 0%, no problem, cover will be fully opened.

Here's a cover attribute:

current_position: 1
travelling_time_down: 20
travelling_time_up: 20
friendly_name: Roleta 4
assumed_state: true
supported_features: 15
device_class: shutter

And entity state is "open"

Edit: Until now I've been using this custom shutter-card: https://github.com/Deejayfool/hass-shutter-card/blob/master/hass-shutter-card.js It also allows inversion and works nicely. Maybe looking at its code will help you to sort this issues out?

mattieha commented 3 years ago

@barmazu I'm still looking into the problem you report. Could u try v1.7.1-beta and test if that fixes some problems?

barmazu commented 3 years ago

Hi @mattieha! With 1.7.1 beta I can confirm all cases reported before are now fixed. Everything is consistent and works as you would expect.