Options
All
  • Public
  • Public/Protected
  • All
Menu

The television device class.

This class manipulates television.

Hierarchy

  • InfraredDevice<TvCommand>
    • Television

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

Protected manipulate

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

    • command: TvCommand

    Returns Promise<Record<string, never>>

setChannel

  • setChannel(channel: number | "prev" | "next"): Promise<Record<string, never>>
  • Change the TV channel.

    Parameters

    • channel: number | "prev" | "next"

      A channel to be set. If channel is a number, set to that specific channel. If channel is prev (resp. next), set to the previous (resp. the next) channel.

    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