Skip to content

Commit

Permalink
Update refreshable-picture-card.js
Browse files Browse the repository at this point in the history
  • Loading branch information
dimagoltsman authored Feb 18, 2021
1 parent 7b1f6c9 commit 7f02a56
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dist/refreshable-picture-card.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

var hassObj = null;
class ResfeshablePictureCard extends HTMLElement {

constructor() {
Expand All @@ -14,13 +15,17 @@ class ResfeshablePictureCard extends HTMLElement {
this._config = cardConfig
}



set hass(hass) {

hassObj = hass;


const config = this._config;

// console.log(hassObj.states[config.entity_picture]["attributes"][config.attribute])

let picture = config.static_picture;
let title = config.title || ""

Expand Down Expand Up @@ -111,7 +116,7 @@ class ResfeshablePictureCard extends HTMLElement {

_bindrefresh(card, hass, config){
var picture = card.getElementsByClassName(`thePic`)[0];
// console.log(hass.states[config.entity_picture]["attributes"][config.attribute])


let refreshTime = config.update_interval || 30

Expand All @@ -120,7 +125,7 @@ class ResfeshablePictureCard extends HTMLElement {
var pictureUrl = config.static_picture

if(config.entity_picture){
pictureUrl = hass.states[config.entity_picture]["attributes"][config.attribute]
pictureUrl = hassObj.states[config.entity_picture]["attributes"][config.attribute]


}
Expand Down

0 comments on commit 7f02a56

Please sign in to comment.