@homebridge-plugins/homebridge-smarthq
    Preparing search index...

    Class SmartHQPlatform

    HomebridgePlatform This class is the main constructor for your plugin, this is where you should parse the user config and discover/register accessories with Homebridge.

    Implements

    • DynamicPlatformPlugin
    Index

    Constructors

    Properties

    accessories: PlatformAccessory<SmartHqContext>[]
    api: API
    Characteristic: typeof Characteristic
    debugMode: boolean
    log: Logging
    platformConfig: SmartHQPlatformConfig
    platformLogging: string | undefined
    platformPushRate: number | undefined
    platformRefreshRate: number | undefined
    platformUpdateRate: number | undefined
    Service: typeof Service
    version: string

    Methods

    • This function is invoked when homebridge restores cached accessories from disk at startup. It should be used to setup event handlers for characteristics and update respective values.

      Parameters

      • accessory: PlatformAccessory

      Returns void

    • Parameters

      • ...log: any[]

      Returns Promise<void>

    • Parameters

      • ...log: any[]

      Returns Promise<void>

    • Parameters

      • ...log: any[]

      Returns Promise<void>

    • Parameters

      • ...log: any[]

      Returns Promise<void>

    • This method is used to discover the your location and devices. Accessories are registered by either their DeviceClass, DeviceModel, or DeviceID

      Returns Promise<void>

    • Returns Promise<boolean>

    • Parameters

      • ...log: any[]

      Returns Promise<void>

    • Returns Promise<void>

    • Returns Promise<void>

    • Returns Promise<void>

    • Asynchronously retrieves the version of the plugin from the package.json file.

      This method reads the package.json file located in the parent directory, parses its content to extract the version, and logs the version using the debug logger. The extracted version is then assigned to the version property of the class.

      Returns Promise<void>

      A promise that resolves when the version has been retrieved and logged.

    • If device level logging is turned on, log to log.warn Otherwise send debug logs to log.debug

      Parameters

      • ...log: any[]

      Returns Promise<void>

    • Returns Promise<boolean>

    • Returns Promise<void>

    • Parameters

      • ...log: any[]

      Returns Promise<void>

    • Parameters

      • existingAccessory: PlatformAccessory

      Returns Promise<void>

    • Validate and clean a string value for a Name Characteristic.

      Parameters

      • displayName: string

        The display name of the accessory.

      • name: string

        The name of the characteristic.

      • value: string

        The value to be validated and cleaned.

      Returns Promise<string>

      The cleaned string value.

    • Verify the config passed to the plugin is valid

      Returns Promise<void>

    • Parameters

      • ...log: any[]

      Returns Promise<void>