UNPKG

homebridge-virtual-accessories

Version:
30 lines (29 loc) 1.46 kB
import type { CharacteristicValue, PlatformAccessory } from 'homebridge'; import { VirtualAccessoriesPlatform } from '../platform.js'; import { AccessoryConfiguration } from '../configuration/configurationAccessory.js'; import { Accessory } from './accessory.js'; import { UpdatableChargingState } from './updatableChargingState.js'; /** * Battery - Accessory implementation */ export declare class Battery extends Accessory implements UpdatableChargingState { static readonly ACCESSORY_TYPE_NAME: string; static readonly BATTERY_LEVEL_NORMAL: number; static readonly BATTERY_LEVEL_LOW: number; static readonly NOT_CHARGING: number; static readonly CHARGING: number; static readonly NOT_CHARGEABLE: number; private readonly batteryLevelStorageKey; private readonly chargingStateStorageKey; private lowLevelThreshold; private states; constructor(platform: VirtualAccessoriesPlatform, accessory: PlatformAccessory, accessoryConfiguration: AccessoryConfiguration); getStatusLowBattery(): Promise<CharacteristicValue>; getBatteryLevel(): Promise<CharacteristicValue>; getChargingState(): Promise<CharacteristicValue>; protected getJsonState(): string; protected getAccessoryTypeName(): string; static getStatusLowBatteryName(level: number): string; static getChargingStateName(state: number): string; updateChargingState(charging: boolean, charge: number, accessoryId: string): void; }