homebridge-yale-sync-keypad
Version:
A pluign to connect to your Yale Sync Alarm account and allow you to change the alarm state using Homekit. Motion sensors are not supported, due to the fact that they are only active when the alarm is set to away.
45 lines (44 loc) • 2.11 kB
TypeScript
import type { API, Characteristic, DynamicPlatformPlugin, Logging, PlatformAccessory, PlatformConfig, Service } from 'homebridge';
import { Yale } from 'yalesyncalarm';
/**
* HomebridgePlatform
* This class is the main constructor for your plugin, this is where you should
* parse the user config and discover/register accessories with Homebridge.
*/
export declare class YaleSyncKeypadPlatform implements DynamicPlatformPlugin {
readonly log: Logging;
readonly config: PlatformConfig;
readonly api: API;
readonly Service: typeof Service;
readonly Characteristic: typeof Characteristic;
readonly yaleSyncApi?: Yale;
lastApiCall: Date | null;
private panelData;
private panel;
readonly accessories: Map<string, PlatformAccessory>;
readonly discoveredCacheUUIDs: string[];
constructor(log: Logging, config: PlatformConfig, api: API);
/**
* This function is invoked when homebridge restores cached accessories from disk at startup.
* It should be used to set up event handlers for characteristics and update respective values.
*/
configureAccessory(accessory: PlatformAccessory): void;
/**
* This is an example method showing how to register discovered accessories.
* Accessories must only be registered once, previously created accessories
* must not be registered again to prevent "duplicate UUID" errors.
*/
discoverDevices(): Promise<void>;
/**
* Remove accessories which are no longer present in the discovered cache.
* This will remove accessories which have been manually removed from the Yale Sync account
*/
private removeOldAccessories;
/**
* The lifecycle method is used to fetch the panel state from the Yale Sync API at regular intervals and update the accessory state
* @param refresh True if the user wants to refresh the panel state in the background
* @param refreshInterval The number of seconds to wait before refreshing the panel state
* @returns Promise<void>
*/
lifecycle(refresh: boolean, refreshInterval: number): Promise<void>;
}