Crate lg_webos_client[][src]

Expand description

WebOS TV websocket client allowing to communicate in request-response manner.


Create client and send command

use lg_webos_client::client::*;
use lg_webos_client::command::Command;

async fn main() {
    // Note: We must specify the ws protocol, and if we do not have the key, we must use a blank str.
    let config = WebOsClientConfig::new("ws://","");

    let mut client = WebosClient::new(config).await.unwrap();
    let resp = client.send_command(Command::GetChannelList).await.unwrap();
    println!("Got response {:?}", resp.payload);