Filter null badges (#3645)

* Convert weather-forecast to LitElement

Part of https://github.com/home-assistant/home-assistant-polymer/issues/2095

Not sure how RTL works and how to apply it.

Also, thinking I should update if the forecast changes and not just the state. Input?

* Revert "Convert weather-forecast to LitElement"

This reverts commit e1893b0a83f5973df7a28e5d30c3d4d0496155a1.

* Filter out null badges

Closes https://github.com/home-assistant/home-assistant-polymer/issues/2974

* address review comments

* Update hui-view.ts
This commit is contained in:
Ian Richardson 2019-09-09 11:31:20 -05:00 committed by GitHub
parent 8a710202f1
commit f2999c30f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -264,7 +264,8 @@ export class HUIView extends LitElement {
} }
const elements: HUIView["_badges"] = []; const elements: HUIView["_badges"] = [];
const badges = processConfigEntities(config.badges); // It's possible that a null value was stored as a badge entry
const badges = processConfigEntities(config.badges.filter(Boolean));
for (const badge of badges) { for (const badge of badges) {
const element = document.createElement("ha-state-label-badge"); const element = document.createElement("ha-state-label-badge");
const entityId = badge.entity; const entityId = badge.entity;