homebridge-air
Advanced tools
Comparing version 1.0.0-beta.15 to 1.0.0-beta.16
@@ -70,25 +70,27 @@ import { interval } from 'rxjs'; | ||
const param = provider === 'airnow' ? this.deviceStatus.find((p) => p.ParameterName === pollutant) : this.deviceStatus.iaqi[pollutant]?.v; | ||
const aqi = provider === 'airnow' ? Number.parseFloat(param.AQI.toString()) : Number.parseFloat(param); | ||
if (aqi !== undefined) { | ||
switch (pollutant.toLowerCase()) { | ||
case 'o3': | ||
this.AirQualitySensor.OzoneDensity = aqi; | ||
break; | ||
case 'pm2.5': | ||
this.AirQualitySensor.PM2_5Density = aqi; | ||
break; | ||
case 'pm10': | ||
this.AirQualitySensor.PM10Density = aqi; | ||
break; | ||
case 'no2': | ||
this.AirQualitySensor.NitrogenDioxideDensity = aqi; | ||
break; | ||
case 'so2': | ||
this.AirQualitySensor.SulphurDioxideDensity = aqi; | ||
break; | ||
case 'co': | ||
this.AirQualitySensor.CarbonMonoxideLevel = aqi; | ||
break; | ||
if (param !== undefined) { | ||
const aqi = provider === 'airnow' ? Number.parseFloat(param.AQI.toString()) : Number.parseFloat(param); | ||
if (!Number.isNaN(aqi)) { | ||
switch (pollutant.toLowerCase()) { | ||
case 'o3': | ||
this.AirQualitySensor.OzoneDensity = aqi; | ||
break; | ||
case 'pm2.5': | ||
this.AirQualitySensor.PM2_5Density = aqi; | ||
break; | ||
case 'pm10': | ||
this.AirQualitySensor.PM10Density = aqi; | ||
break; | ||
case 'no2': | ||
this.AirQualitySensor.NitrogenDioxideDensity = aqi; | ||
break; | ||
case 'so2': | ||
this.AirQualitySensor.SulphurDioxideDensity = aqi; | ||
break; | ||
case 'co': | ||
this.AirQualitySensor.CarbonMonoxideLevel = aqi; | ||
break; | ||
} | ||
this.AirQualitySensor.AirQuality = HomeKitAQI(Math.max(0, aqi)); | ||
} | ||
this.AirQualitySensor.AirQuality = HomeKitAQI(Math.max(0, aqi)); | ||
} | ||
@@ -95,0 +97,0 @@ }); |
@@ -5,3 +5,3 @@ { | ||
"type": "module", | ||
"version": "1.0.0-beta.15", | ||
"version": "1.0.0-beta.16", | ||
"description": "The AirNow plugin allows you to monitor the current AirQuality for your Zip Code from HomeKit and Siri.", | ||
@@ -8,0 +8,0 @@ "author": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
333395
3092