import { CharacteristicValue, Logger, PlatformAccessory, Service, WithUUID } from 'homebridge'; import { LogMessageEvent, PingMessageEvent, StateUpdateMessageEvent } from '../utils/eventsource'; import { BlaQHomebridgePluginPlatform } from '../platform'; import type { RequestInfo, RequestInit, Response } from 'node-fetch'; export interface BaseBlaQAccessoryInterface { setAPIBaseURL: (apiBaseURL: string) => void; handleStateEvent: (stateEvent: StateUpdateMessageEvent) => void; handleLogEvent?: (logEvent: LogMessageEvent) => void; handlePingEvent?: (pingEvent: PingMessageEvent) => void; resetSyncState: () => void; } export type BaseBlaQAccessoryConstructorParams = { accessory: PlatformAccessory; apiBaseURL: string; apiUser?: string; apiPass?: string; friendlyName: string; platform: BlaQHomebridgePluginPlatform; serialNumber: string; }; export declare const correctAPIBaseURL: (inputURL: string) => string; export declare class BaseBlaQAccessory implements BaseBlaQAccessoryInterface { protected apiBaseURL: string; protected user?: string; protected pass?: string; protected firmwareVersion?: string; protected synced?: boolean; protected queuedEvents: { type: 'state' | 'log' | 'ping'; event: StateUpdateMessageEvent | LogMessageEvent | PingMessageEvent; }[]; /** Legacy entity key -> REST path that this device is known to accept. */ private readonly entityPaths; protected readonly accessory: PlatformAccessory; protected readonly accessoryInformationService: Service; protected readonly logger: Logger; protected readonly friendlyName: string; protected readonly platform: BlaQHomebridgePluginPlatform; protected readonly serialNumber: string; constructor({ accessory, apiBaseURL, apiUser, apiPass, friendlyName, platform, serialNumber, }: BaseBlaQAccessoryConstructorParams); protected getSelfClassName(): string; protected getOrAddService(service: WithUUID | Service): Service; protected removeService(service: WithUUID | Service): void; processQueuedEvents(): void; resetSyncState(): void; handlePingEvent(pingEvent: PingMessageEvent): void; handleLogEvent(logEvent: LogMessageEvent): void; handleStateEvent(stateEvent: StateUpdateMessageEvent): void; getFirmwareVersion(): CharacteristicValue; protected setFirmwareVersion(version: string): void; setAPIBaseURL(url: string): void; /** * POSTs an action to an entity, falling back through the known URL formats on a 404 so that the * same code works against firmware from either side of the ESPHome 2026.7 URL change, and * regardless of which spelling of the entity's object_id the device settled on. */ protected entityFetch(entityKeys: string[], action?: string, query?: string): Promise; protected authFetch(url: URL | RequestInfo, init?: RequestInit): Promise; }