Skip to content

Commit

Permalink
Small update
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten committed Feb 13, 2020
1 parent e936a9b commit 9bb5f23
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
10 changes: 5 additions & 5 deletions dist/weather-card-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const fireEvent = (node, type, detail, options) => {
const event = new Event(type, {
bubbles: options.bubbles === undefined ? true : options.bubbles,
cancelable: Boolean(options.cancelable),
composed: options.composed === undefined ? true : options.composed,
composed: options.composed === undefined ? true : options.composed
});
event.detail = detail;
node.dispatchEvent(event);
Expand All @@ -24,7 +24,7 @@ const css = LitElement.prototype.css;

export class WeatherCardEditor extends LitElement {
setConfig(config) {
this._config = config;
this._config = { ...config };
}

static get properties() {
Expand Down Expand Up @@ -61,7 +61,7 @@ export class WeatherCardEditor extends LitElement {
}

const entities = Object.keys(this.hass.states).filter(
(eid) => eid.substr(0, eid.indexOf(".")) === "weather"
eid => eid.substr(0, eid.indexOf(".")) === "weather"
);

return html`
Expand Down Expand Up @@ -100,7 +100,7 @@ export class WeatherCardEditor extends LitElement {
slot="dropdown-content"
.selected="${entities.indexOf(this._entity)}"
>
${entities.map((entity) => {
${entities.map(entity => {
return html`
<paper-item>${entity}</paper-item>
`;
Expand Down Expand Up @@ -146,7 +146,7 @@ export class WeatherCardEditor extends LitElement {
this._config = {
...this._config,
[target.configValue]:
target.checked !== undefined ? target.checked : target.value,
target.checked !== undefined ? target.checked : target.value
};
}
}
Expand Down
10 changes: 4 additions & 6 deletions dist/weather-card.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const LitElement = Object.getPrototypeOf(customElements.get("hui-view"));
const html = LitElement.prototype.html;
const css = LitElement.prototype.css;

const weatherIconsDay = {
clear: "day",
Expand Down Expand Up @@ -133,7 +134,6 @@ class WeatherCard extends LitElement {
}

return html`
${this.renderStyle()}
<ha-card @click="${this._handleClick}">
${this._config.current !== false ? this.renderCurrent(stateObj) : ""}
${this._config.details !== false ? this.renderDetails(stateObj) : ""}
Expand Down Expand Up @@ -251,9 +251,7 @@ class WeatherCard extends LitElement {
</div>
<i
class="icon"
style="background: none, url('${this.getWeatherIcon(
daily.condition.toLowerCase()
)}') no-repeat; background-size: contain;"
style=`background: none, url('${this.getWeatherIcon(daily.condition.toLowerCase())}') no-repeat; background-size: contain`
></i>
<div class="highTemp">
${daily.temperature}${this.getUnit("temperature")}
Expand Down Expand Up @@ -315,8 +313,8 @@ class WeatherCard extends LitElement {
return 3;
}

renderStyle() {
return html`
static get styles() {
return css`
<style>
ha-card {
cursor: pointer;
Expand Down

0 comments on commit 9bb5f23

Please sign in to comment.