jeremypsl
(Jérémy P.)
November 18, 2021, 10:48am
1
Hello
Im trying to put some button-card entities in a multiple entity row one.
This is my code :
type: entities
entities:
- entity: switch.led_ch_1
type: custom:multiple-entity-row
entities:
- entity: sensor.led_ch_1_device_temperature
type: custom:button-card
name: ' '
show_icon: false
show_name: false
show_state: true
styles:
card:
- color: |
[[[
if (entity.state < 60) return 'white';
if (entity.state >= 60) return 'orange';
if (entity.state >= 80) return 'red';
]]]
If i remove the multiple entity row it’s working…
Thanks.
You are doing smth which was not specified as a supported feature.
jeremypsl
(Jérémy P.)
November 18, 2021, 5:19pm
3
You mean if it is not planned by the dev, we can’t use a custom component in another custom component ?
if it is not supported officially - you cannot.
Still you may try anything…
With apologies for the thread necromancy, I got around this by re-implementing the multiple-entity-row control using layout-card’s flexible grid control, which fully supports button-card controls.
I really like the compact layout of the multiple-entity-row custom control, but it doesn’t allow you to define different double-click and hold actions. Also, the styling is not as flexible as button-card.
I have therefore re-implemented the design using a few custom controls, namely vertical-stack-in-card, layout-card’s flexible grid control, and of course button-card. I thought I’d share the code in case it was useful to others
While I have put my entitles on actual buttons, because that ma…