thomasloven / lovelace-state-switch

🔹Dynamically replace lovelace cards depending on occasion
MIT License
382 stars 27 forks source link

flip transition and ios #45

Closed Glacierdk closed 2 years ago

Glacierdk commented 3 years ago

Hi

I am having some weird issues the the state-switch in combination with the custom:button-card (https://github.com/custom-cards/button-card). I dont know if the problem lies with the state-switch or the button, however ill try posting here :)

I have tried to setup the following code: https://pastebin.com/dsPK3dyJ (i removed alot of code to make it more simple to go through)

The idea is to use the state-switch to show different buttons depending on what room (state) is selected. The problem only happens when using the "flip" transition, and it only happens on iOS. Android and PC works fine.

Whenever i add more than one state, only the last added state is working as it should. When using buttons on all other states than the last one added, the buttons doesnt activate properly.

Here is an example of what is happening. Lets say i have 2 states Living room and kitchen (kitchen was added last). Each state has 3 buttons aligned horizontally. The buttons are as follows: Livingroom: desk-lamp - led strip - Ceilling lights Kitchen: All Lights - table - sink

If i go to the living room state and hit the "Ceilling lights" button it will toggle the "all lights" button in the kitchen tab. If i hit the "desk lamp" button it will activate the "sink" button on the kitchen tab.

This happens with all the tabs except the last one. It is always the mirrored button that activates. button 1 activates button 3, button 2->2 and button 3->1

If I substitute the "custom:button-card" with an ordinary button, it works fine.

I hope this made any sense. Any idea on what is going wrong?

crixle commented 3 years ago

Not the dev, but I eliminated the issue by just turning off the animations entirely and changing the cards based on the URL hash. The dev has a whole section about it, it's very easy.

keiferoh commented 3 years ago

I just revamped my mobile dashboards this weekend and I can verify I have the same issue, but only when using the "Flip" transition. Any other transition works (slide and swap).

Only an issue on the Home Assistant iOS app. Both Safari and Chrome on my Mac work as expected.

I am also using Custom Button Card, but I tried the default Button Card in HA and it has the same issue when using the Flip transition.

ASNNetworks commented 2 years ago

Came here to confirm. Still present running on iOS and HA (2021.7.3). I hope this get fixed soon. I only have one iOS device and multiple Android ones, a shame that iOS is holding everything else back (with web).