Skip to content

Commit

Permalink
fix: remove dependency on configuration - final
Browse files Browse the repository at this point in the history
  • Loading branch information
chilikla authored Oct 18, 2024
1 parent b5d88b3 commit 435bf54
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/card/yerushamayim-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ function loadCSS(url) {

loadCSS("https://fonts.googleapis.com/css2?family=Rubik&display=swap");

const ENTITY = "sensor.yerushamayim";

class YerushamayimCard extends LitElement {
static get properties() {
return {
Expand All @@ -23,8 +25,7 @@ class YerushamayimCard extends LitElement {
}

render() {
const entityId = this.config.entity;
const state = this.hass.states[entityId];
const state = this.hass.states[ENTITY];
const stateStr = state ? state.state : 'unavailable';
const logUrl = this.hass.states['sun.sun'].state === 'below_horizon' ? 'https://www.02ws.co.il/img/logo_night.png' : 'https://www.02ws.co.il/img/logo.png';

Expand Down Expand Up @@ -95,9 +96,6 @@ class YerushamayimCard extends LitElement {
}

setConfig(config) {
if (!config.entity) {
throw new Error('You need to define an entity');
}
this.config = config;
}

Expand Down

0 comments on commit 435bf54

Please sign in to comment.