bfishadow / homebridge-laser-egg

A plugin for homebridge to support first gen Laser Egg air quality monitors.
8 stars 7 forks source link

Issue with "very low pm2.5" data leading to "Unknown" status in HomeKit #8

Open llagasse opened 6 years ago

llagasse commented 6 years ago

Hello, I am hoping the authors are still interested in supporting this code. I find the laseregg amazing and was one of the first few buyers and I am so happy to see someone wrote this pluggin so that I can automate more. The issue is, I am actually very well isolating rooms and I can reach level of pm2.5 so low that the AQI result from calcAQI() is equal to "0". This return a status of "0" from the function trans_aqi() that is an enum state in the HomeKit of "Unknown". So, the calcAQI() return should be limit to 1 as a minimum and error management should only flat the the "0" state if it is not possible to retrive the data from the API. If someone is still listening, I would be happy to participate into the code update as a first pluggin development.