Open TinyShark opened 1 year ago
Interestingly, I left the page open overnight and the buttons have appeared. Upon refresh they disappear again...
If I use a duplicate of the card, without being wrapped within state-switch (left card) and press the buttons, they then appear on the problematic card (right card). After a browser refresh they disappear again.
Your 1st post contains a code with ~500 lines. Not sure that someone will try to reproduce it. To demonstrate an issue, people usually post a Minimal Working Example - a short code snippet. Sometimes people even resolve issues themselves while preparing an MWE.
Does not display button card (Chrome).
layout_card > state_switch > stack_in_card > layout_card > custom_button_card...
If I refresh my browser continuously, the button will sometimes appear in the below example. Does not appear however many times I refresh on my full config.
Displays button card every-other browser refresh (Chrome).
state_switch > stack_in_card > layout_card > custom_button_card...
Displays button card as expected (Chrome).
state_switch > layout_card > custom_button_card...
Testing example:
- type: custom:layout-card
layout_type: grid
layout:
margin: 0
grid-template-rows: 1fr
grid-template-columns: 30% 1fr 30%
grid-template-areas: |
". stat2 ."
cards:
- type: custom:state-switch
view_layout:
grid-area: stat2
justify-self: center
align-self: stretch
entity: hash
transition: flip-y
default: p1
states:
p1:
type: custom:stack-in-card
keep:
margin: false
box_shadow: false
background: false
cards:
- type: custom:layout-card
layout_type: grid
layout:
margin: 0
padding: 0
card_margin: 0
place-items: center
grid-template-rows: 5.5vh
grid-template-columns: >-
minmax(50px, 1fr) minmax(50px, 2fr)
minmax(20px, 1fr) minmax(20px, 1fr) 4%
grid-column-gap: 1%
grid-template-areas: |
"icon name button1 button1 ."
cards:
- type: custom:mushroom-template-card
view_layout:
grid-area: icon
align-self: center
entity: sensor.wiser_hot_water
tap_action:
action: navigate
navigation_path: '#p2'
icon: mdi:water-boiler
icon_color: white
primary: Hot Water
- type: custom:button-card
icon: mdi:power
view_layout:
grid-area: button1
entity: sensor.wiser_hot_water_operation_mode
color_type: card
color: rgba(255,255,255,1)
show_state: false
show_icon: true
show_name: false
size: 40%
styles:
grid:
- grid-template-areas: '"i"'
- grid-template-rows: 1fr
- grid-template-columns: 1fr
This is not an MWE.
type: custom:layout-card
layout_type: grid
cards:
- type: custom:state-switch
entity: hash
default: noworky
states:
noworky:
type: custom:stack-in-card
cards:
- type: custom:layout-card
layout_type: grid
cards:
- type: custom:button-card
icon: mdi:image-broken
Check your conditions:
entity: hash
default: noworky
states:
noworky:
Works with an input_boolean
(not appears fast after a browser's page reload):
type: custom:layout-card
layout_type: grid
cards:
- type: custom:state-switch
entity: input_boolean.test_boolean
default: 'off'
states:
'off':
type: custom:stack-in-card
cards:
- type: entity
entity: sun.sun
- type: custom:layout-card
layout_type: grid
cards:
- type: button
icon: mdi:car
entity: sun.sun
'on':
type: custom:stack-in-card
cards:
- type: custom:layout-card
layout_type: grid
cards:
- type: button
icon: mdi:car
entity: sun.sun
- type: button
icon: mdi:car
entity: sun.sun
- type: entity
entity: sun.sun
Yes a normal type: button
indeed works as expected with either hash
or input_boolean
but type: custom:button-card
does not show with either condition.
Seems to be a conflict between custom:button-card
and state-switch
type: custom:layout-card
layout_type: grid
cards:
- type: entities
entities:
- input_boolean.test_boolean
- type: custom:layout-card
layout_type: grid
cards:
- type: custom:state-switch
entity: input_boolean.test_boolean
default: 'off'
states:
'off':
type: custom:stack-in-card
cards:
- type: entity
entity: sun.sun
- type: custom:layout-card
layout_type: grid
cards:
- type: button
icon: mdi:car
entity: sun.sun
'on':
type: custom:stack-in-card
cards:
- type: custom:layout-card
layout_type: grid
cards:
- type: button
icon: mdi:car
entity: sun.sun
- type: custom:button-card
icon: mdi:car
entity: sun.sun
- type: entity
entity: sun.sun
Seems to be a conflict between
custom:button-card
andstate-switch
You got quite a hamburger. Try to remove the 1st layer (1st layout-card).
An odd but necessary hamburger unfortunately!
However, removing the first custom:layout-card
does not work properly either. I would say it shows more frequently than with the layout card, but it's hit or miss between browser refreshes of whether it displays.
- type: entities
entities:
- input_boolean.test_boolean
- type: custom:layout-card
layout_type: grid
cards:
- type: custom:state-switch
entity: input_boolean.test_boolean
default: 'off'
states:
'off':
type: custom:stack-in-card
cards:
- type: entity
entity: sun.sun
- type: custom:layout-card
layout_type: grid
cards:
- type: button
icon: mdi:car
entity: sun.sun
'on':
type: custom:stack-in-card
cards:
- type: custom:layout-card
layout_type: grid
cards:
- type: button
icon: mdi:car
entity: sun.sun
- type: custom:button-card
icon: mdi:car
entity: sun.sun
- type: entity
entity: sun.sun
I have an issue on a card that I have created that when inside a state-switch card, does not display correctly and is missing the buttons defined within their grid-areas. The grid layout still exists and is correct but the content is not visible.
This is the card, without state-switch:
This is the card, wrapped inside state-switch:
This is my YAML for the config: