UNPKG

@homebridge-plugins/homebridge-air

Version:

The AirNow plugin allows you to monitor the current AirQuality for your Zip Code from HomeKit and Siri.

57 lines 2.1 kB
import type { CharacteristicValue, PlatformAccessory, Service } from 'homebridge'; import type { AirPlatform } from '../platform.js'; import type { devicesConfig } from '../settings.js'; import { deviceBase } from './device.js'; /** * Platform Accessory * An instance of this class is created for each accessory your platform registers * Each accessory may expose multiple services of different service types. */ export declare class AirQualitySensor extends deviceBase { readonly platform: AirPlatform; AirQualitySensor: { Service: Service; Name: CharacteristicValue; AirQuality: CharacteristicValue; OzoneDensity: CharacteristicValue; NitrogenDioxideDensity: CharacteristicValue; SulphurDioxideDensity: CharacteristicValue; PM2_5Density: CharacteristicValue; PM10Density: CharacteristicValue; CarbonMonoxideLevel: CharacteristicValue; StatusFault: CharacteristicValue; }; private availablePollutants; SensorUpdateInProgress: boolean; deviceStatus: any; private lastRequestTime; private lastResponseData; private readonly cacheMaxAge; private apiCallCount; private apiCallResetTime; constructor(platform: AirPlatform, accessory: PlatformAccessory, device: devicesConfig); /** * Parse the device status from the Air api */ parseStatus(): Promise<void>; /** * Reverse geocode lat/long to get zip code using Nominatim (OpenStreetMap) * This is used as a fallback when lat/long endpoint fails */ reverseGeocodeToZipCode(latitude: number, longitude: number): Promise<{ zipCode: string; city: string; } | null>; /** * Asks the Air API for the latest device information */ refreshStatus(): Promise<void>; private isTimeoutError; private executeApiRequestWithFallback; /** * Updates the status for each of the HomeKit Characteristics */ updateHomeKitCharacteristics(): Promise<void>; apiError(_e: any): Promise<void>; } //# sourceMappingURL=airqualitysensor.d.ts.map