UNPKG

homebridge-config-ui-x

Version:

A web based management, configuration and control platform for Homebridge.

98 lines (97 loc) 5.04 kB
import { OnApplicationBootstrap } from '@nestjs/common'; import { AccessoryConfig, HomebridgeConfig, HomebridgeUiBridgeConfig, PlatformConfig } from '../../core/config/config.interfaces.js'; import { ConfigService } from '../../core/config/config.service.js'; import { JsonFileStoreService } from '../../core/fs/json-file-store.service.js'; import { HomebridgeIpcService } from '../../core/homebridge-ipc/homebridge-ipc.service.js'; import { Logger } from '../../core/logger/logger.service.js'; import { MatterConfig } from '../../core/matter/matter.interfaces.js'; import { SchedulerService } from '../../core/scheduler/scheduler.service.js'; import { BackupService } from '../backup/backup.service.js'; import { ChildBridgesService } from '../child-bridges/child-bridges.service.js'; import { PluginsService } from '../plugins/plugins.service.js'; export interface ConfigEditorRestartInfo<T> { config: T; affectedBridges: Awaited<ReturnType<ChildBridgesService['getChildBridges']>>; } export declare class ConfigEditorService implements OnApplicationBootstrap { private readonly logger; private readonly configService; private readonly schedulerService; private readonly pluginsService; private readonly homebridgeIpcService; private readonly childBridgesService; private readonly backupService; private readonly jsonStore; private readonly ready; private resolveReady; constructor(logger: Logger, configService: ConfigService, schedulerService: SchedulerService, pluginsService: PluginsService, homebridgeIpcService: HomebridgeIpcService, childBridgesService: ChildBridgesService, backupService: BackupService, jsonStore: JsonFileStoreService); onApplicationBootstrap(): Promise<void>; private start; private scheduleConfigBackupCleanup; getConfigFile(): Promise<HomebridgeConfig>; private assertRestartCommandsSafe; updateConfigFile(config: HomebridgeConfig): Promise<HomebridgeConfig>; getConfigForPlugin(pluginName: string): Promise<(PlatformConfig | AccessoryConfig)[]>; updateConfigForPlugin(pluginName: string, pluginConfig: Record<string, any>[]): Promise<Record<string, any>[]>; getPropertyForUi(property: string): Promise<any>; setPropertyForUi(property: string, value: any): Promise<void>; setPropertiesForUi(properties: Record<string, any>): Promise<void>; private applyPropertyToPluginConfig; setAccessoryControlInstanceBlacklist(value: string[]): Promise<void>; getPluginsHideUpdatesFor(): Promise<string[]>; setPluginsHideUpdatesFor(value: string[]): Promise<void>; getPluginsHideChildBridgeSetupFor(): Promise<string[]>; setPluginsHideChildBridgeSetupFor(value: string[]): Promise<void>; getBridge(username: string): Promise<HomebridgeUiBridgeConfig | null>; private updateBridgeProperty; setBridgeHideHapAlert(username: string, value: boolean): Promise<void>; setBridgeHideMatterAlert(username: string, value: boolean): Promise<void>; setBridgeScheduledRestartCron(username: string, value: string | null): Promise<void>; disablePlugin(pluginName: string): Promise<string[]>; enablePlugin(pluginName: string): Promise<string[]>; private buildRestartInfo; updateConfigFileWithRestartInfo(config: HomebridgeConfig): Promise<ConfigEditorRestartInfo<HomebridgeConfig>>; updateConfigForPluginWithRestartInfo(pluginName: string, pluginConfig: Record<string, any>[]): Promise<ConfigEditorRestartInfo<Record<string, any>[]>>; disablePluginWithRestartInfo(pluginName: string): Promise<ConfigEditorRestartInfo<string[]>>; enablePluginWithRestartInfo(pluginName: string): Promise<ConfigEditorRestartInfo<string[]>>; listConfigBackups(): Promise<{ id: string; timestamp: Date; file: string; }[]>; getConfigBackup(backupId: number): Promise<NonSharedBuffer>; deleteConfigBackup(backupId: number): Promise<void>; deleteAllConfigBackups(): Promise<void>; private ensureBackupPathExists; cleanupConfigBackups(): Promise<void>; private migrateConfigBackups; generatePin(): string; generateUsername(): string; private removeEmpty; private cleanUpUiConfig; getMatterPortRange(): Promise<{ start?: number; end?: number; }>; setMatterPortRange(value: { start?: number; end?: number; }): Promise<void>; private validateMatterPortRange; getMatterConfig(): Promise<MatterConfig | null>; updateMatterConfig(matterConfig: MatterConfig): Promise<MatterConfig>; setMatterEnabled(enabled: boolean, restart?: boolean, externalsOnly?: boolean): Promise<{ enabled: boolean; externalsOnly: boolean; }>; deleteMatterConfig(): Promise<void>; getHapEnabled(): Promise<{ enabled: boolean; externalsOnly: boolean; }>; setHapEnabled(enabled: boolean, restart?: boolean, externalsOnly?: boolean): Promise<{ enabled: boolean; externalsOnly: boolean; }>; private validateMatterConfig; }