Class RemoteController

Handles everything needed to implement a fully working HomeKit remote controller.

Hierarchy

Implements

Constructors

  • Creates a new RemoteController. If siri voice input is supported the constructor to an SiriAudioStreamProducer needs to be supplied. Otherwise, a remote without voice support will be created.

    For every audio session a new SiriAudioStreamProducer will be constructed.

    Parameters

    • Optional audioProducerConstructor: SiriAudioStreamProducerConstructor

      constructor for a SiriAudioStreamProducer

    • Optional producerOptions: any

      if supplied this argument will be supplied as third argument of the SiriAudioStreamProducer constructor. This should be used to supply configurations to the stream producer.

    Returns RemoteController

Properties

activeIdentifier: number = 0
targetConfigurations: Map<number, TargetConfiguration> = ...

Methods

  • Returns the targetIdentifier for a give device name

    Returns

    The targetIdentifier of the device or undefined if not existent.

    Parameters

    • name: string

      The name of the device.

    Returns undefined | number

  • Returns

    if the current target is active, meaning the active device is listening for button events or audio sessions

    Returns boolean

  • Checks if the supplied targetIdentifier is configured.

    Parameters

    • targetIdentifier: number

      The target identifier.

    Returns boolean

  • Presses a supplied button for a given time.

    Parameters

    • button: ButtonType

      button to be pressed and released

    • time: number = 200

      time in milliseconds (defaults to 200ms)

    Returns void

  • Set a new target as active target. A value of 0 indicates that no target is selected currently.

    Parameters

    • activeIdentifier: number

      target identifier

    Returns void