Skip to content

Commit

Permalink
Merge pull request #45 from Swampen/master
Browse files Browse the repository at this point in the history
Fixes WAQI parse check
  • Loading branch information
dnguyen800 authored Apr 30, 2021
2 parents 4e29bf9 + 3f4d00b commit 46ff440
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dist/air-visual-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ class AirVisualCard extends HTMLElement {
}
// Check if APL is an WAQI sensor (because the state is an integer). Returns 'NaN' if it is not a number
if (typeof hass.states[aplSensor.config] != "undefined") {
if (parseInt(hass.states[aplSensor.config].state) != 'NaN') {
let aplParse = parseInt(hass.states[aplSensor.config].state)
if (!isNaN(aplParse)) {
apl = APLdescription[getAQI()];
} else {
apl = hass.states[aplSensor.config].state;
Expand Down

0 comments on commit 46ff440

Please sign in to comment.