homebridge-config-ui-x
Version:
A web based management, configuration and control platform for Homebridge.
146 lines (145 loc) • 5.08 kB
TypeScript
import type { MultipartFile } from '@fastify/multipart';
import type { Systeminformation } from 'systeminformation';
import type { NetworkOverviewEntry, StoredMatterAccessory } from '../../core/matter/matter.interfaces.js';
import { ServiceUnavailableException } from '@nestjs/common';
import { ConfigService } from '../../core/config/config.service.js';
import { HomebridgeIpcService } from '../../core/homebridge-ipc/homebridge-ipc.service.js';
import { Logger } from '../../core/logger/logger.service.js';
import { AccessoriesService } from '../accessories/accessories.service.js';
import { ConfigEditorService } from '../config-editor/config-editor.service.js';
import { HomebridgeMdnsSettingDto } from './server.dto.js';
export declare class ServerService {
private readonly configService;
private readonly configEditorService;
private readonly accessoriesService;
private readonly homebridgeIpcService;
private readonly logger;
private serverServiceCache;
private readonly accessoryId;
private readonly accessoryInfoPath;
setupCode: string | null;
paired: boolean;
constructor(configService: ConfigService, configEditorService: ConfigEditorService, accessoriesService: AccessoriesService, homebridgeIpcService: HomebridgeIpcService, logger: Logger);
private static macToHex;
private static hexToMac;
private deleteSingleDeviceAccessories;
private deleteSingleDevicePairing;
restartServer(): Promise<{
ok: boolean;
command: string;
restartingUI: boolean;
}>;
resetHomebridgeAccessory(): Promise<void>;
getDevicePairings(): Promise<any[]>;
private getMatterExternalAccessories;
getDevicePairingById(deviceId: string, configFile?: any): Promise<any>;
deleteDevicePairing(id: string, resetPairingInfo: boolean): Promise<{
ok: boolean;
}>;
deleteDeviceMatterConfig(id: string): Promise<{
ok: boolean;
}>;
deleteDevicesPairing(bridges: {
id: string;
resetPairingInfo: boolean;
}[]): Promise<{
ok: boolean;
}>;
deleteDeviceAccessories(id: string): Promise<void>;
deleteDevicesAccessories(bridges: {
id: string;
protocol?: 'hap' | 'matter' | 'both';
}[]): Promise<void>;
getCachedAccessories(): Promise<any[]>;
deleteCachedAccessory(uuid: string, cacheFile: string): Promise<{
ok: boolean;
}>;
deleteCachedAccessories(accessories: {
uuid: string;
cacheFile: string;
}[]): Promise<{
ok: boolean;
}>;
deleteAllCachedAccessories(): Promise<{
ok: boolean;
}>;
getMatterAccessories(): Promise<StoredMatterAccessory[]>;
deleteMatterAccessory(deviceId: string, uuid: string): Promise<{
ok: boolean;
}>;
deleteMatterAccessories(accessories: {
deviceId: string;
uuid: string;
}[]): Promise<{
ok: boolean;
}>;
getSetupCode(): Promise<string | null>;
private generateSetupCode;
getBridgePairingInformation(): Promise<ServiceUnavailableException | {
displayName: any;
pincode: any;
setupCode: string;
isPaired: boolean;
}>;
getSystemNetworkInterfaces(): Promise<Systeminformation.NetworkInterfacesData[]>;
getHomebridgeNetworkInterfaces(): Promise<string[]>;
getHomebridgeMdnsSetting(): Promise<HomebridgeMdnsSettingDto>;
setHomebridgeMdnsSetting(setting: HomebridgeMdnsSettingDto): Promise<void>;
setHomebridgeNetworkInterfaces(adapters: string[]): Promise<void>;
lookupUnusedPort(): Promise<{
port: number;
}>;
lookupUnusedMatterPort(): Promise<{
port: number;
}>;
getHomebridgePort(): Promise<{
port: number;
}>;
getUsablePorts(): Promise<{
start?: number;
end?: number;
}>;
setHomebridgeName(name: string): Promise<void>;
setHomebridgePort(port: number): Promise<void>;
setUsablePorts(value: {
start?: number;
end?: number;
}): Promise<void>;
getNetworkOverview(): Promise<{
entries: NetworkOverviewEntry[];
conflicts: string[];
}>;
uploadWallpaper(data: MultipartFile): Promise<void>;
deleteWallpaper(): Promise<void>;
private nodeVersionChanged;
uploadSslKeyCert(req: any): Promise<{
ok: boolean;
type: 'keycert';
keyPath: string;
certPath: string;
details?: string;
}>;
uploadSslPfx(req: any): Promise<{
ok: boolean;
type: 'pfx';
pfxPath: string;
details?: string;
}>;
validateCurrentSslConfig(): Promise<{
ok: boolean;
valid: boolean;
type: 'off' | 'selfsigned' | 'keycert' | 'pfx';
details?: string;
}>;
generateSelfSignedCertificate(options?: {
hostnames?: string[];
mode?: 'keycert' | 'selfsigned';
}): Promise<{
ok: boolean;
type: 'generated';
mode: 'keycert' | 'selfsigned';
keyPath?: string;
certPath?: string;
details?: string;
}>;
}