@homebridge-plugins/homebridge-air
Version:
The AirNow plugin allows you to monitor the current AirQuality for your Zip Code from HomeKit and Siri.
41 lines • 1.59 kB
TypeScript
import type { AirMatterPlatform } from '../AirMatterPlatform.js';
import type { devicesConfig } from '../settings.js';
/**
* AirQualitySensorMatter
*
* Handles periodic AQI data fetching for a single Air Quality sensor registered
* as a Matter accessory. On each polling cycle it fetches from the same provider
* URLs used by the HAP AirQualitySensor class, converts the raw AQI value to a
* HomeKit-level integer (1-5), and delegates to
* {@link AirMatterPlatform.updateMatterAirQuality} which maps it to the Matter
* `AirQualityEnum` (0-6) before pushing the state update to Homebridge.
*/
export declare class AirQualitySensorMatter {
private readonly platform;
private readonly device;
private readonly uuid;
private updateInProgress;
private lastRequestTime;
private lastAqi;
private readonly cacheMaxAge;
private apiCallCount;
private apiCallResetTime;
constructor(platform: AirMatterPlatform, device: devicesConfig, uuid: string);
/**
* Fetch the latest AQI data from the provider and push the result to the
* registered Matter accessory state.
*/
refreshStatus(): Promise<void>;
/**
* Build the provider API URL using the same logic as AirQualitySensor.refreshStatus.
*/
private buildUrl;
/**
* Extract the overall AQI from the raw API response and convert it to a
* HomeKit AQI level (1-5) using the shared HomeKitAQI helper.
*/
private parseAqi;
private isTimeoutError;
private executeApiRequestWithFallback;
}
//# sourceMappingURL=airqualitysensormatter.d.ts.map