UNPKG

@homebridge-plugins/homebridge-rainbird

Version:

The Rainbird plugin allows you to access your Rainbird device(s) from HomeKit.

105 lines 5.24 kB
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']; platformUpdateRate: RainbirdPlatformConfig['updateRate']; debugMode: boolean; 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; private registerHandler; private createPlatformAccessory; supportsStackRunZone(deviceId: string): boolean; protected detectControllerCapabilities(rainbird: RainBirdService): Promise<ControllerCapabilities>; 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<void>; private createIrrigationSystem; private createLeakSensor; FirmwareRevision(rainbird: RainBirdService, device: devicesConfig): Promise<string>; createZoneValve(device: devicesConfig, rainbird: RainBirdService, zoneId: number): Promise<void>; removeZoneValve(device: devicesConfig, rainbird: RainBirdService, zoneId: number): void; createContactSensor(device: devicesConfig, rainbird: RainBirdService, zoneId: number): Promise<void>; removeContactSensor(device: devicesConfig, rainbird: RainBirdService, zoneId: number): void; createTestZoneSwitch(device: devicesConfig, rainbird: RainBirdService, zoneId: number, supportsTestZone: boolean): Promise<void>; removeTestZoneSwitch(device: devicesConfig, rainbird: RainBirdService, zoneId: number): void; createProgramSwitch(device: devicesConfig, rainbird: RainBirdService, programId: string): Promise<void>; createStopIrrigationSwitch(device: devicesConfig, rainbird: RainBirdService): Promise<void>; createDelayIrrigationSwitch(device: devicesConfig, rainbird: RainBirdService): Promise<void>; externalOrPlatform(device: devicesConfig, accessory: PlatformAccessory): Promise<void>; externalAccessory(accessory: PlatformAccessory): Promise<void>; unregisterPlatformAccessories(existingAccessory: PlatformAccessory): void; getPlatformLogSettings(): Promise<void>; getPlatformRateSettings(): Promise<void>; getPlatformConfigSettings(): Promise<void>; /** * 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<void>} A promise that resolves when the version has been retrieved and logged. */ getVersion(): Promise<void>; /** * 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<string>; /** * If device level logging is turned on, log to log.warn * Otherwise send debug logs to log.debug */ infoLog(...log: any[]): Promise<void>; successLog(...log: any[]): Promise<void>; debugSuccessLog(...log: any[]): Promise<void>; warnLog(...log: any[]): Promise<void>; debugWarnLog(...log: any[]): Promise<void>; errorLog(...log: any[]): Promise<void>; debugErrorLog(...log: any[]): Promise<void>; debugLog(...log: any[]): Promise<void>; loggingIsDebug(): Promise<boolean>; enablingPlatformLogging(): Promise<boolean>; } export {}; //# sourceMappingURL=Platform.HAP.d.ts.map