import { HAP, Logging, PlatformAccessory } from 'homebridge'; import { OtoApiClient } from './otoApi'; import { OtoZone } from './transport'; /** * Configures a single PlatformAccessory (one OTO controller) as a HomeKit * IrrigationSystem with one linked Valve per zone. * * This class exists because getting the HAP service graph wrong throws * "Cannot add a Service with the same UUID ... without a unique subtype": * - The accessory already ships an AccessoryInformation service, so we reuse * it via getService() and never addService() a second one. * - Every Valve is added with a unique subtype (the zoneId) and fetched with * getServiceById(...) ?? addService(...), so re-discovery never duplicates. * - Each Valve is linked to the single IrrigationSystem service. */ export declare class SprinklerAccessory { private readonly log; private readonly accessory; private readonly controllerId; private readonly apiClient; private readonly hap; private readonly irrigationService; private readonly valves; constructor(hap: HAP, log: Logging, accessory: PlatformAccessory, controllerId: string, zones: OtoZone[], apiClient: OtoApiClient); /** Idempotently create and wire the Valve for one zone. */ private configureZone; /** * Refresh valve states from a freshly-fetched zone list. OTO only exposes * device-level activity, so every zone on a controller reports the same * watering flag; we surface it on each valve and roll it up to the system. */ updateFromZones(zones: OtoZone[]): void; private setValveActive; /** * Keep this zone's valve switch ON for `seconds`, surfacing a live HomeKit * countdown via RemainingDuration, then turn it off automatically. Any * previously scheduled auto-off for the zone is replaced. */ private scheduleAutoOff; /** Cancel a zone's pending auto-off timer, if any. */ private clearAutoOff; /** Watering finished on its own: flip the switch off and reset the countdown. */ private finishZone; private rollUpSystemInUse; } //# sourceMappingURL=sprinklerAccessory.d.ts.map