homebridge-eufy-security
Version:
Control Eufy Security from homebridge.
86 lines • 3.68 kB
TypeScript
import { Characteristic, PlatformAccessory, CharacteristicValue } from 'homebridge';
import { EufySecurityPlatform } from '../platform';
import { BaseAccessory } from './BaseAccessory';
import { Station, PropertyName, PropertyValue, AlarmEvent } from 'eufy-security-client';
import { StationConfig } from '../utils/configTypes';
export declare enum HKGuardMode {
STAY_ARM = 0,
AWAY_ARM = 1,
NIGHT_ARM = 2,
DISARM = 3
}
export interface EufyMode {
hk: number;
eufy: number;
}
/**
* Platform Accessory
* An instance of this class is created for each accessory your platform registers
* Each accessory may expose multiple services of different service types.
*/
export declare class StationAccessory extends BaseAccessory {
readonly stationConfig: StationConfig;
readonly hasKeyPad: boolean;
private readonly modes;
private alarm_triggered;
private alarm_delayed;
private alarm_delay_timeout?;
private guardModeChangeTimeout;
constructor(platform: EufySecurityPlatform, accessory: PlatformAccessory, device: Station);
/**
* Get the current value of the "propertyName" characteristic
*/
protected getPropertyValue(propertyName: PropertyName): PropertyValue;
protected setPropertyValue(propertyName: PropertyName, value: unknown): Promise<void>;
/**
* Gets the station configuration based on several possible sources.
* Priority is given to custom configurations (if available), then falls back to global configs,
* and lastly uses default values if neither custom nor global configs are set.
*
* @returns {StationConfig} The final configuration settings for the station
*/
private getStationConfig;
private mappingHKEufy;
private onStationGuardModePushNotification;
private onStationCurrentModePushNotification;
onStationAlarmEventPushNotification(characteristic: Characteristic, alarmEvent: AlarmEvent): void;
/**
* Convert a HomeKit mode number to its corresponding Eufy mode number.
* Searches the `this.modes` array to find a matching HomeKit mode.
* Throws an error if a matching mode is not found.
*
* @param {number} hkMode - The HomeKit mode to convert
* @returns {number} The corresponding Eufy mode
* @throws {Error} If a matching mode is not found
*/
convertHKtoEufy(hkMode: number): number;
/**
* Convert a Eufy mode number to its corresponding HomeKit mode number.
* Searches the `this.modes` array to find a matching Eufy mode.
* Throws an error if a matching mode is not found.
*
* @param {number} eufyMode - The Eufy mode to convert
* @returns {number} The corresponding HomeKit mode
* @throws {Error} If a matching mode is not found
*/
convertEufytoHK(eufyMode: number): number;
/**
* Handle requests to get the current value of the 'Security System Current State' characteristic
*/
protected handleSecuritySystemCurrentStateGet(): CharacteristicValue;
/**
* Handle requests to get the current value of the 'Security System Target State' characteristic
*/
private handleSecuritySystemTargetStateGet;
/**
* Handle requests to set the 'Security System Target State' characteristic
*/
private handleSecuritySystemTargetStateSet;
private handleManualTriggerSwitchStateGet;
private handleManualTriggerSwitchStateSet;
onStationAlarmDelayedEvent(station: Station, armDelay: number): void;
onStationAlarmArmedEvent(): void;
getGuardModeName(value: CharacteristicValue): string;
private updateManuelTriggerButton;
}
//# sourceMappingURL=StationAccessory.d.ts.map