Hi friends. I have several media_players objects and I want to know how to extract the images from those that are active. I tried to do it but I can only extract it on a tamplate.
I leave the code to see if they realize it since when translating the language out there it is not understood.
Hi friends. I have several media_players objects and I want to know how to extract the images from those that are active. I tried to do it but I can only extract it on a tamplate.
I leave the code to see if they realize it since when translating the language out there it is not understood.
(pass by url the entity_picture attribute of a media player)
Thank you
Thank you
styles:
custom_fields:
media_image:
- background-position: center center
- background-image: >
[[[
if(states['media_player.pablo_y_silvy'].state === 'playing')
return "url(" + {{state_attr('media_player.pablo_y_silvy', 'entity_picture')}} +")";
else
return "url('/local/img/multimedia.jfif')";
]]]