Hi everyone,
I’m currently working on an open/close button functionality for a panel in my OpenHAB UI, but I’m running into issues. My goal is to have one button to open a “f7-card expandable” and another hide it and show a close button to close it. Here’s the code I’m using so far:
default:
- component: oh-button
config:
class:
- cell-open-button
- card-opened-fade-out
color: black
iconF7: expand
iconSize: 20px
visible: =!vars.cardOpen
action: variable
actionVariable: cardOpen
actionVariableValue: true
style:
background-color: white
text-align: right
- component: oh-button
config:
class:
- card-opened-fade-in
- cell-close-button
- card-close
visible: =vars.cardOpen
color: black
iconF7: xmark
iconSize: 20px
style:
background-color: white
text-align: right
action: variable
actionVariable: cardOpen
actionVariableValue: false
The idea is that the expand
button is only visible when the variable cardOpen
is set to false
, and the xmark
button only when cardOpen
is true
. However, the visibility doesn’t work as expected, and the buttons behave inconsistently.
Does anyone have an idea what I might be doing wrong? Or is there a better way to achieve this functionality?
I appreciate any suggestions or advice!
Thank you in advance,