sarahhenkens / home-assistant-iocare

27 stars 15 forks source link

Round Air Quality Index Value #12

Closed RobertD502 closed 3 years ago

RobertD502 commented 3 years ago

Current air quality index returns a long decimal value when anything other than "20". This can be problematic when using the air quality index with custom cards such as "purifier card". This change converts the returned air quality index to an integer which is then rounded to 1 decimal place.

Prior to Rounding: Purifier Pre-Round

With Rounding: Purifier Post-Round

RobertD502 commented 3 years ago

Disregard this pull request. Further testing reveals some values return "ValueError: invalid literal for int() with base 10: ". Creating new pull request to solve this problem.