Initializes a new instance of the LGTVHandler class.
The WebSocket protocol ('ws' or 'wss').
The IP address of the LG TV.
The port number for the WebSocket connection.
The MAC address of the LG TV for WOL.
Optional
keyPath: string(Optional) Custom path for storing client keys. Defaults to './keys'.
Activates the screensaver on the TV.
A promise indicating the result of the operation.
Periodically checks and ensures the sound output matches the desired setting.
The desired sound output setting.
A message if the sound output value is invalid.
Decreases the current TV channel by one.
A promise indicating the result of the operation.
Increases the current TV channel by one.
A promise indicating the result of the operation.
Closes a specific alert dialog on the TV.
The ID of the alert to close.
A promise indicating the result of the operation.
Closes the app launcher on the TV.
A promise indicating the result of the operation.
Closes a specific toast notification on the TV.
The ID of the toast to close.
A promise indicating the result of the operation.
Closes a web application running on the TV.
A promise indicating the result of the operation.
Retrieves the list of installed apps on the TV.
A promise with the list of apps.
Retrieves the state of a specific app on the TV.
The ID of the app.
A promise with the app state information.
Retrieves the current audio status.
A promise with the audio status information.
Retrieves the current calibration settings.
A promise with the calibration settings.
Retrieves information about a specific TV channel.
The ID of the channel.
A promise with the channel information.
Retrieves the list of available TV channels.
A promise with the list of channels.
Retrieves the current configuration settings.
A promise with the configuration settings.
Retrieves information about the currently running app.
A promise with the current app information.
Retrieves the currently active TV channel.
A promise with the current channel information.
Retrieves the list of input sources.
A promise with the available input sources.
Retrieves the input socket information.
A promise with the input socket information.
Retrieves the current power state of the TV.
A promise with the power state information.
Retrieves the list of services from the TV.
A promise with the services information.
Retrieves software information from the TV.
A promise with the software information.
Gets the current sound output settings.
A promise with the sound output information.
Retrieves system information from the TV.
A promise with the system information.
Retrieves system settings from the TV.
A promise with the system settings.
Gets the current volume level.
A promise with the volume information.
Inserts text into the currently focused input field on the TV.
The text to insert.
A promise indicating the result of the operation.
Launches a specific app on the TV.
The ID of the app to launch.
A promise with the launch app response.
Lists all devices connected to the TV.
A promise with the list of devices.
Closes the currently playing media on the TV.
A promise indicating the result of the operation.
Fast-forwards media playback on the TV.
A promise indicating the result of the operation.
Pauses media playback on the TV.
A promise indicating the result of the operation.
Plays media on the TV.
A promise indicating the result of the operation.
Rewinds media playback on the TV.
A promise indicating the result of the operation.
Stops media playback on the TV.
A promise indicating the result of the operation.
Reboots the TV.
A promise indicating the result of the operation.
Sends a "Delete" key press to the TV.
A promise indicating the result of the operation.
Sends an "Enter" key press to the TV.
A promise indicating the result of the operation.
Sends a message through the WebSocket connection.
The type of the message ('register', 'request', etc.).
Optional
uri: stringThe specific endpoint URI.
Optional
payload: anyThe payload data to send.
The prefix for the URI (default is 'ssap://').
A promise that resolves with the server's response.
Turns off 3D mode on the TV.
A promise indicating the result of the operation.
Turns on 3D mode on the TV.
A promise indicating the result of the operation.
Sets new calibration settings.
The calibration data to set.
A promise indicating the result of the operation.
Sets the TV to a specific channel.
The ID of the channel to set.
A promise indicating the result of the operation.
Sets the active input source.
The ID of the input source to activate.
A promise indicating the result of the operation.
Sets the TV's audio mute status
Sets the sound output to the specified mode.
The desired sound output mode.
A promise with the sound output response.
Sets the TV volume to a specified level.
The desired volume level.
A promise indicating the result of the operation.
Displays an alert dialog on the TV.
The message to display in the alert.
A promise indicating the result of the operation.
Displays the input picker UI on the TV.
A promise indicating the result of the operation.
Displays a toast notification on the TV.
The message to display in the toast.
A promise indicating the result of the operation.
Takes a screenshot of the current TV display.
A promise indicating the result of the operation.
Toggles the TV's audio mute
Turns off the TV screen.
A promise indicating the result of the operation.
Turns on the TV screen.
A promise indicating the result of the operation.
Decreases the TV volume by one step.
A promise with the volume response.
Increases the TV volume by one step.
A promise with the volume response.
The LGTVHandler class manages the connection and interactions with an LG TV. It handles WebSocket communication, registration, and provides methods to control various TV functionalities.