homebridge-pura
Version:
Homebridge plugin for Pura smart fragrance diffusers
51 lines (50 loc) • 1.59 kB
TypeScript
import type { CharacteristicValue, PlatformAccessory } from 'homebridge';
import type { PuraPlatform } from './platform.js';
import { PuraApi } from './puraApi.js';
import { PuraDevice } from './puraTypes.js';
/**
* Pura Platform Accessory
* An instance of this class is created for each bay of each Pura device
* Each accessory exposes a Fan service to represent the fragrance diffuser
*/
export declare class PuraPlatformAccessory {
private readonly platform;
private readonly accessory;
private readonly puraApi;
private service;
private device;
private bayNumber;
/**
* Track the current state of the diffuser
*/
private currentState;
constructor(platform: PuraPlatform, accessory: PlatformAccessory, puraApi: PuraApi);
/**
* Update current state from device data
*/
private updateCurrentState;
/**
* Get the bay data for this accessory
*/
private getBay;
/**
* Handle "SET" requests from HomeKit for On/Off
*/
setOn(value: CharacteristicValue): Promise<void>;
/**
* Handle the "GET" requests from HomeKit for On/Off
*/
getOn(): Promise<CharacteristicValue>;
/**
* Handle "SET" requests from HomeKit for RotationSpeed (intensity)
*/
setRotationSpeed(value: CharacteristicValue): Promise<void>;
/**
* Handle the "GET" requests from HomeKit for RotationSpeed (intensity)
*/
getRotationSpeed(): Promise<CharacteristicValue>;
/**
* Update device data and refresh state
*/
updateDevice(device: PuraDevice): void;
}