Filter out non number states instead of assigning them 0 (#1987)

This commit is contained in:
Karl Kihlström 2018-11-05 16:28:36 +01:00 committed by Paulus Schoutsen
parent e5fe2950af
commit cf19ceb193

View File

@ -115,7 +115,9 @@ class HuiSensorCard extends EventsMixin(LitElement) {
}
_getValueArr(items) {
return items.map((item) => Number(item.state) || 0);
return items
.map((item) => Number(item.state))
.filter((val) => !Number.isNaN(val));
}
_calcCoordinates(values, width, height) {