Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Samsung

Hierarchy

  • Samsung

Index

Constructors

constructor

Properties

Private APP_STRING

APP_STRING: string

Private IP

IP: string

Private LOGGER

LOGGER: Logger

Private MAC

MAC: string

Private NAME_APP

NAME_APP: string

Private PORT

PORT: number

Private SAVE_TOKEN

SAVE_TOKEN: boolean

Private TOKEN

TOKEN: string

Private TOKEN_FILE

TOKEN_FILE: string = path.join(__dirname, 'token.txt')

Private TV_APP_STRING

TV_APP_STRING: string

Private WS_URL

WS_URL: string

Methods

Private _saveTokenToFile

  • _saveTokenToFile(token: string): void
  • Parameters

    • token: string

    Returns void

Private _send

  • _send(command: Command, done?: undefined | ((err: null | (Error & { code: string }), res: WSData | null) => void), eventHandle?: undefined | string): void
  • Parameters

    • command: Command
    • Optional done: undefined | ((err: null | (Error & { code: string }), res: WSData | null) => void)
    • Optional eventHandle: undefined | string

    Returns void

Private _sendLegacy

  • _sendLegacy(key: KEYS, done?: undefined | ((err: null | Error | { code: string }, res: string) => void)): void
  • Parameters

    • key: KEYS
    • Optional done: undefined | ((err: null | Error | { code: string }, res: string) => void)

    Returns void

Private _sendLegacyPromise

  • _sendLegacyPromise(key: KEYS): Promise<unknown>

Private _sendPromise

  • _sendPromise(command: Command, eventHandle?: undefined | string): Promise<WSData | null>
  • Parameters

    • command: Command
    • Optional eventHandle: undefined | string

    Returns Promise<WSData | null>

getAppsFromTV

  • getAppsFromTV(done?: undefined | ((err: Error | { code: string } | null, res: WSData | string | null) => void)): void
  • Parameters

    • Optional done: undefined | ((err: Error | { code: string } | null, res: WSData | string | null) => void)

    Returns void

getAppsFromTVPromise

  • getAppsFromTVPromise(): Promise<WSData | null>

Private getLegacyCommand

  • getLegacyCommand(key: KEYS): { command: string; header: string }
  • Parameters

    Returns { command: string; header: string }

    • command: string
    • header: string

getLogs

  • getLogs(): void

getToken

  • getToken(done: (token: string | null) => void): void
  • Parameters

    • done: (token: string | null) => void
        • (token: string | null): void
        • Parameters

          • token: string | null

          Returns void

    Returns void

getTokenPromise

  • getTokenPromise(): Promise<string>

isAvaliable

  • isAvaliable(): Promise<string>

isAvaliablePing

  • isAvaliablePing(): Promise<string>

openApp

  • openApp(appId: string, done?: undefined | ((err: Error | { code: string } | null, res: WSData | string | null) => void)): void
  • Parameters

    • appId: string
    • Optional done: undefined | ((err: Error | { code: string } | null, res: WSData | string | null) => void)

    Returns void

openAppPromise

  • openAppPromise(appId: string): Promise<unknown>
  • Parameters

    • appId: string

    Returns Promise<unknown>

sendKey

  • sendKey(key: KEYS, done?: undefined | ((err: Error | { code: string } | null, res: WSData | string | null) => void)): void
  • Parameters

    • key: KEYS
    • Optional done: undefined | ((err: Error | { code: string } | null, res: WSData | string | null) => void)

    Returns void

sendKeyPromise

  • sendKeyPromise(key: KEYS): Promise<unknown>

turnOn

  • turnOn(): Promise<string>

Generated using TypeDoc