Options
All
  • Public
  • Public/Protected
  • All
Menu

The speaker device class.

This class manipulates speaker.

Hierarchy

  • InfraredDevice<SpeakerCommand>
    • Speaker

Index

Constructors

constructor

Properties

Protected Readonly client

client: RestClient

Protected Readonly deviceId

deviceId: string

Protected Readonly deviceType

deviceType: RegExp = ...

Methods

changeVolume

  • changeVolume(volume: "up" | "down"): Promise<Record<string, never>>
  • Change the volume.

    Parameters

    • volume: "up" | "down"

      If set to up (resp. down), the volume level increases (resp. decreases).

    Returns Promise<Record<string, never>>

fastForward

  • fastForward(): Promise<Record<string, never>>
  • Fast-forward the track.

    Returns Promise<Record<string, never>>

Protected manipulate

  • manipulate(command: SpeakerCommand): Promise<Record<string, never>>
  • Parameters

    • command: SpeakerCommand

    Returns Promise<Record<string, never>>

pause

  • pause(): Promise<Record<string, never>>
  • Pause the track.

    Returns Promise<Record<string, never>>

play

  • play(): Promise<Record<string, never>>
  • Play or resume the track.

    Returns Promise<Record<string, never>>

rewind

  • rewind(): Promise<Record<string, never>>
  • Rewind the track.

    Returns Promise<Record<string, never>>

skipTo

  • skipTo(direction: "prev" | "next"): Promise<Record<string, never>>
  • Skip to either the previous track or the next one.

    Parameters

    • direction: "prev" | "next"

      If set to prev (resp. next), skip to the previous (resp. the next) track.

    Returns Promise<Record<string, never>>

stop

  • stop(): Promise<Record<string, never>>
  • Stop the track.

    Returns Promise<Record<string, never>>

toggleMute

  • toggleMute(): Promise<Record<string, never>>
  • Mute or unmute the speaker.

    Returns Promise<Record<string, never>>

turnOff

  • turnOff(): Promise<Record<string, never>>
  • Turn off the device.

    Returns Promise<Record<string, never>>

    Response of the command execution.

turnOn

  • turnOn(): Promise<Record<string, never>>
  • Turn on the device.

    Returns Promise<Record<string, never>>

    Response of the command execution.

validateId

  • validateId(): Promise<boolean>
  • Check if the device type associated with the device ID is consistent with the class.

    throws

    Will throw an error if the device ID is not found in the infrared remote list.

    Returns Promise<boolean>

    true if the device type is consistent with the class, false otherwise.

Generated using TypeDoc