homebridge
    Preparing search index...

    Interface API

    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;
    }
    Index

    Properties

    hap: __module
    hapLegacyTypes: __module
    platformAccessory: typeof PlatformAccessory
    serverVersion: string

    The current homebridge semver version.

    user: typeof User
    version: number

    The homebridge API version as a floating point number.

    Methods

    • Parameters

      • event: "didFinishLaunching"
      • listener: () => void

      Returns this

    • Parameters

      • event: "shutdown"
      • listener: () => void

      Returns this

    • 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 true

      Parameters

      • version: string

      Returns boolean