docs/interfaces/API.html
Export types for basically everything but the actual API implementation
interface API {
hap: __module;
hapLegacyTypes: __module;
platformAccessory: typeof PlatformAccessory;
serverVersion: string;
user: typeof User;
version: number;
on(event: "didFinishLaunching", listener: () => void): this;
on(event: "shutdown", listener: () => void): this;
publishCameraAccessories(
pluginIdentifier: string,
accessories: PlatformAccessory<UnknownContext>[],
): void;
publishExternalAccessories(
pluginIdentifier: string,
accessories: PlatformAccessory<UnknownContext>[],
): void;
registerAccessory(
accessoryName: string,
constructor: AccessoryPluginConstructor,
): void;
registerAccessory(
pluginIdentifier: string,
accessoryName: string,
constructor: AccessoryPluginConstructor,
): void;
registerPlatform<Config extends PlatformConfig>(
platformName: string,
constructor: PlatformPluginConstructor<Config>,
): void;
registerPlatform<Config extends PlatformConfig>(
pluginIdentifier: string,
platformName: string,
constructor: PlatformPluginConstructor<Config>,
): void;
registerPlatformAccessories(
pluginIdentifier: string,
platformName: string,
accessories: PlatformAccessory<UnknownContext>[],
): void;
unregisterPlatformAccessories(
pluginIdentifier: string,
platformName: string,
accessories: PlatformAccessory<UnknownContext>[],
): void;
updatePlatformAccessories(
accessories: PlatformAccessory<UnknownContext>[],
): void;
versionGreaterOrEqual(version: string): boolean;
}
haphapLegacyTypesplatformAccessoryserverVersionuserversion
onpublishCameraAccessoriespublishExternalAccessoriesregisterAccessoryregisterPlatformregisterPlatformAccessoriesunregisterPlatformAccessoriesupdatePlatformAccessoriesversionGreaterOrEqual
Readonlyhaphap: __module
ReadonlyhapLegacyTypeshapLegacyTypes: __module
ReadonlyplatformAccessoryplatformAccessory: typeof PlatformAccessory
ReadonlyserverVersionserverVersion: string
The current homebridge semver version.
Readonlyuseruser: typeof User
Readonlyversionversion: number
The homebridge API version as a floating point number.
on(event: "didFinishLaunching", listener: () => void): this
on(event: "shutdown", listener: () => void): this
publishCameraAccessories(
pluginIdentifier: string,
accessories: PlatformAccessory<UnknownContext>[],
): void
use publishExternalAccessories directly to publish a standalone Accessory
publishExternalAccessories(
pluginIdentifier: string,
accessories: PlatformAccessory<UnknownContext>[],
): void
registerAccessory(
accessoryName: string,
constructor: AccessoryPluginConstructor,
): void
registerAccessory(
pluginIdentifier: string,
accessoryName: string,
constructor: AccessoryPluginConstructor,
): void
registerPlatform<Config extends PlatformConfig>(
platformName: string,
constructor: PlatformPluginConstructor<Config>,
): void
registerPlatform<Config extends PlatformConfig>(
pluginIdentifier: string,
platformName: string,
constructor: PlatformPluginConstructor<Config>,
): void
registerPlatformAccessories(
pluginIdentifier: string,
platformName: string,
accessories: PlatformAccessory<UnknownContext>[],
): void
unregisterPlatformAccessories(
pluginIdentifier: string,
platformName: string,
accessories: PlatformAccessory<UnknownContext>[],
): void
updatePlatformAccessories(
accessories: PlatformAccessory<UnknownContext>[],
): void
versionGreaterOrEqual(version: string): boolean
Returns true if the current running homebridge version is greater or equal to the passed version string.
Example:
We assume the homebridge version 1.3.0-beta.12 (serverVersion) and the following example calls below
versionGreaterOrEqual("1.2.0"); // will return true versionGreaterOrEqual("1.3.0"); // will return false (the RELEASE version 1.3.0 is bigger than the BETA version 1.3.0-beta.12) versionGreaterOrEqual("1.3.0-beta.8); // will return trueCopy
Member Visibility
ThemeOSLightDark
Properties haphapLegacyTypesplatformAccessoryserverVersionuserversion Methods onpublishCameraAccessoriespublishExternalAccessoriesregisterAccessoryregisterPlatformregisterPlatformAccessoriesunregisterPlatformAccessoriesupdatePlatformAccessoriesversionGreaterOrEqual