Skip to content

Commit

Permalink
Fixes constant refresh. Bumps to version 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
luixal committed Dec 31, 2023
1 parent fa0944b commit efeeac8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions media-source-image-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ class MediaSourceImageCard extends HTMLElement {
if (!this.content) this.renderBase();
// resolve image from media source and render it:
if (!this.image || this.image != this.config.image) {
this.image = this.config.image;
this.getImageUrl(this.config.image)
.then(imageUrl => {
this.image = imageUrl;
hass.callWS({
type: "media_source/resolve_media",
media_content_id: this.image
media_content_id: imageUrl
}).then(response => {
this.content.innerHTML = `<img src=${response.url} class="${(this.config.entity_id && this.config.apply_grayscale) ? hass.states[this.config.entity_id].state : ''}">`;
}).catch(error => {
Expand Down Expand Up @@ -163,7 +163,7 @@ window.customCards.push({
});

console.info(
`%c MEDIA SOURCE IMAGE CARD %c Version 0.1.2 `,
`%c MEDIA SOURCE IMAGE CARD %c Version 0.2.0 `,
'color: orange; font-weight: bold; background: black',
'color: white; font-weight: bold; background: dimgray',
);

0 comments on commit efeeac8

Please sign in to comment.