import type { API, DynamicPlatformPlugin, Logging, PlatformAccessory } from 'homebridge'; import type { AugustPlatformConfig, credentials, device, devicesConfig, options } from './settings.js'; import August from 'august-yale'; import { ConnectivityManager } from './connectivity-manager.js'; /** * 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 AugustPlatform implements DynamicPlatformPlugin { accessories: PlatformAccessory[]; readonly api: API; readonly log: Logging; config: AugustPlatformConfig; platformConfig: AugustPlatformConfig; platformLogging: options['logging']; platformRefreshRate: options['refreshRate']; platformPushRate: options['pushRate']; platformUpdateRate: options['updateRate']; registeringDevice: boolean; version: string; protected discoveryReturnedDevices: boolean; private readonly lastPolledAt; augustConfig?: August; connectivity?: ConnectivityManager; private readonly lockMechanisms; private pollTimer?; private normalizedCredentialsCache?; constructor(log: Logging, config: AugustPlatformConfig, api: API); /** * This function is invoked when homebridge restores cached accessories from disk at startup. * It should be used to setup event handlers for characteristics and update respective values. */ configureAccessory(accessory: PlatformAccessory): Promise; /** * Verify the config passed to the plugin is valid */ verifyConfig(): Promise; /** * This method looks to see if session is already Validate, if not then sends a validateCode and saves the installId. * After validateCode is saved to the config user must restart homebridge * this process then looks to see if session is already validated and if the validateCode in config; * if isValidated is false then it will validate iwth the validateCode and save isValidated as true in the config.json file * will also make the validateCode undefined */ validated(): Promise; augustCredentials(): Promise; /** * Normalize credentials for August API compatibility * Handle country code variations that may cause 403 errors * Maps regional country codes to supported API endpoints */ private normalizeCredentialsForApi; /** * Clear the normalized credentials cache * Should be called when credentials are updated */ clearNormalizedCredentialsCache(): void; /** * Public method to get normalized credentials for use by device classes * Uses caching to avoid repeated normalization of the same credentials */ getNormalizedCredentials(): Promise; /** * Start the platform-level poll cycle. Iterates registered locks * SERIALLY (not in parallel) and short-circuits on the first failure. * * Why serial: * - One outstanding request at a time on a healthy network is cheap * enough (most cycles complete in <1s for a handful of locks) and * avoids racing the August API. * - On a failing network, a parallel cycle would produce N timeouts * ~simultaneously, which is exactly the log-spam pattern the * ConnectivityManager exists to prevent. Serial means one timeout, * classified once, and the rest of the cycle aborts. * * Why short-circuit on first failure: * - If the first call fails with a network error, the manager has * already entered 'degraded' state and scheduled a probe. The * remaining N-1 calls would all hit the same dead network and * produce identical errors. Aborting the cycle is the correct * thing to do. * * Why skip when offline: * - The manager's state machine is already managing recovery via * scheduled probes. Polling on top of that just wastes API calls * and risks rate limiting. */ startPolling(): void; /** Stop the platform poll cycle. Called from shutdown paths. */ stopPolling(): void; pluginConfig(): Promise<{ pluginConfig: any; currentConfig: any; }>; /** * This method is used to discover the your location and devices. */ discoverDevices(): Promise; protected Lock(device: device & devicesConfig): Promise; registerDevice(device: device & devicesConfig): Promise; externalOrPlatform(device: device & devicesConfig, accessory: PlatformAccessory): Promise; externalAccessory(accessory: PlatformAccessory): Promise; unregisterPlatformAccessories(existingAccessory: PlatformAccessory, device: device & devicesConfig): Promise; /** * Tear down the LockMechanism for a given lockId, releasing its PubNub * subscription. Called when an accessory is unregistered (either via * explicit removal or excludeLockIds config). */ /** Stop everything this platform started. The Matter platform extends this. */ protected shutdownPlatform(): void; private tearDownLockMechanism; getPlatformLogSettings(): Promise; getPlatformRateSettings(): Promise; getPlatformConfigSettings(): Promise; /** * Asynchronously retrieves the version of the plugin from the package.json file. * * This method reads the package.json file located in the parent directory, * parses its content to extract the version, and logs the version using the debug logger. * The extracted version is then assigned to the `version` property of the class. * * @returns {Promise} A promise that resolves when the version has been retrieved and logged. */ getVersion(): Promise; /** * Validate and clean a string value for a Name Characteristic. * @param displayName - The display name of the accessory. * @param name - The name of the characteristic. * @param value - The value to be validated and cleaned. * @returns The cleaned string value. */ validateAndCleanDisplayName(displayName: string, name: string, value: string): Promise; /** * If device level logging is turned on, log to log.warn * Otherwise send debug logs to log.debug */ infoLog(...log: any[]): Promise; successLog(...log: any[]): Promise; debugSuccessLog(...log: any[]): Promise; warnLog(...log: any[]): Promise; debugWarnLog(...log: any[]): Promise; errorLog(...log: any[]): Promise; debugErrorLog(...log: any[]): Promise; debugLog(...log: any[]): Promise; /** * ⚠️ True in a normal install, because 'debugMode' means "let Homebridge * decide" rather than "debug is on". Only ever gate 'log.debug' on this. * * Gating 'log.warn', 'log.error' or 'log.success' on it prints those lines to * everyone, since Homebridge shows those levels whatever its debug setting - * which is exactly what happened to three of the helpers above (#243). */ loggingIsDebug(): Promise; enablingPlatformLogging(): Promise; } //# sourceMappingURL=Platform.HAP.d.ts.map