import type { API, DynamicPlatformPlugin, HAP, Logging, PlatformAccessory } from 'homebridge'; import type { devicesConfig, RainbirdPlatformConfig } from './settings.js'; import { RainBirdService } from 'rainbird'; interface ControllerCapabilities { supportsControllerFirmwareVersion: boolean; supportsRetrieveSchedule: boolean; supportsWaterBudget: boolean; supportsZonesSeasonalAdjustFactor: boolean; supportsTestZone: boolean; supportsControllerEventTimestamp: boolean; supportsStackRunZone: boolean; } /** * 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 RainbirdPlatform implements DynamicPlatformPlugin { accessories: PlatformAccessory[]; private readonly handlers; private readonly controllerCapabilities; readonly api: API; readonly log: Logging; protected readonly hap: HAP; config: RainbirdPlatformConfig; platformConfig: RainbirdPlatformConfig; platformLogging: RainbirdPlatformConfig['logging']; platformRefreshRate: RainbirdPlatformConfig['refreshRate']; platformPushRate: RainbirdPlatformConfig['pushRate']; version: string; constructor(log: Logging, config: RainbirdPlatformConfig, 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): void; /** * Finds the cached accessory for an id. The id includes the controller's IP * address, so a controller that moves to a new address gets a new id, and the * Home app would get a second copy without its rooms or automations (#613). * So fall back to the cached accessory with the same serial number and model. */ findCachedAccessory(uuid: string, serialNumber: string, model: string): PlatformAccessory | undefined; private registerHandler; private createPlatformAccessory; supportsStackRunZone(deviceId: string): boolean; protected detectControllerCapabilities(rainbird: RainBirdService): Promise; private logControllerEnhancements; /** * Verify the config passed to the plugin is valid */ verifyConfig(): void; private initialiseConfig; /** * This method is used to discover the your location and devices. */ protected discoverDevices(): Promise; private createIrrigationSystem; private createLeakSensor; FirmwareRevision(rainbird: RainBirdService, device: devicesConfig): Promise; createZoneValve(device: devicesConfig, rainbird: RainBirdService, zoneId: number): Promise; removeZoneValve(device: devicesConfig, rainbird: RainBirdService, zoneId: number): void; createContactSensor(device: devicesConfig, rainbird: RainBirdService, zoneId: number): Promise; removeContactSensor(device: devicesConfig, rainbird: RainBirdService, zoneId: number): void; createTestZoneSwitch(device: devicesConfig, rainbird: RainBirdService, zoneId: number, supportsTestZone: boolean): Promise; removeTestZoneSwitch(device: devicesConfig, rainbird: RainBirdService, zoneId: number): void; createProgramSwitch(device: devicesConfig, rainbird: RainBirdService, programId: string): Promise; createStopIrrigationSwitch(device: devicesConfig, rainbird: RainBirdService): Promise; createDelayIrrigationSwitch(device: devicesConfig, rainbird: RainBirdService): Promise; externalOrPlatform(device: devicesConfig, accessory: PlatformAccessory): Promise; externalAccessory(accessory: PlatformAccessory): Promise; unregisterPlatformAccessories(existingAccessory: PlatformAccessory): void; 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; } export {}; //# sourceMappingURL=Platform.HAP.d.ts.map