RobertD502 / home-assistant-iocare

Home Assistant custom component for monitoring and controlling Coway Airmega Purifiers
MIT License
50 stars 8 forks source link

Lowercase the unit_of_measurement for aqi. #1

Closed smmalis37 closed 2 years ago

smmalis37 commented 2 years ago

While I agree that 'AQI' feels like a better choice this change matches the values reported by the official AirNow integration, allowing values from both to appear on the same graph.

smmalis37 commented 2 years ago

The current unfortunate situation on my dashboard that this would fix: image

RobertD502 commented 2 years ago

I've actually removed AQI as the unit and have implemented the AQI Sensor device class instead. There really shouldn't be a AQI or "aqi" unit as it was written before.

I rewrote the majority of the code and will be pushing out an update shortly.

RobertD502 commented 2 years ago

@smmalis37 New release has been pushed out. Be sure to read up on the changes as there are several breaking changes.

The reason the AirNow integration is showing aqi is because the developer manually made that change. By normal standards the AQI unit is capitalized. If you want it to be aqi then just add that as the native unit of measurement in your own code.

Edit: I apologize. I meant the AQI acronym is capitalized. AQI doesn't have any units which is why Home Assistant doesn't provide the unit as a constant in its constants file. They do however have an AQI device class (which the integration now uses) that correctly doesn't use any units. The Airnow integration has manually added the aqi unit which shouldn't exist just like it was wrong for me to include AQI as the native unit of measurement in previous versions.

smmalis37 commented 2 years ago

https://github.com/home-assistant/core/issues/67302