From 0ffc29428bcabd7d8b5d3f5d4b8f8609f9430ddb Mon Sep 17 00:00:00 2001 From: Ramy Aboul Naga Date: Wed, 18 May 2022 21:54:43 +0200 Subject: [PATCH] Use text entities directly without an attribute --- dist/refreshable-picture-card.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dist/refreshable-picture-card.js b/dist/refreshable-picture-card.js index 6eca93d..08d4ab4 100755 --- a/dist/refreshable-picture-card.js +++ b/dist/refreshable-picture-card.js @@ -120,12 +120,15 @@ class ResfeshablePictureCard extends HTMLElement { let refreshTime = config.update_interval || 30 - + var pictureUrl; let refreshFunc = function(){ - var pictureUrl = config.static_picture + pictureUrl = config.static_picture if(config.entity_picture){ - pictureUrl = hassObj.states[config.entity_picture]["attributes"][config.attribute] + pictureUrl = hassObj.states[config.entity_picture].state + if(config.attribute){ + pictureUrl = hassObj.states[config.entity_picture]["attributes"][config.attribute] + } }