smartcast

Crates.iosmartcast
lib.rssmartcast
version0.1.1
sourcesrc
created_at2021-08-24 03:19:34.233489
updated_at2021-08-25 04:37:02.341115
descriptionAPI to connect and control Vizio SmartCast devices
homepage
repositoryhttps://github.com/ConnorTroy/smartcast
max_upload_size
id441507
size164,615
Connor Troy (ConnorTroy)

documentation

README

SmartCast Api

crates.io Documentation Build

This library provides an API for connecting to and controlling Vizio SmartCast TVs and Speakers. The struct Device provides a client for interfacing with the SmartCast device.

Get Started

You can use smartcast::discover_devices() to find SmartCast devices on your local network by issuing an SSDP Query or attempt to connect directly using Device::by_ip() or Device::by_uuid().

Example

use smartcast::Device;

async fn example_main() -> Result<(), smartcast::Error> {

    let ssdp_devices = smartcast::discover_devices().await?;

    let dev_by_ssdp = ssdp_devices[0].clone();
    let ip_addr = dev_by_ssdp.ip();
    let uuid = dev_by_ssdp.uuid();

    let dev_by_ip = Device::from_ip(ip_addr).await?;
    let dev_by_uuid = Device::from_uuid(uuid).await?;

    assert_eq!(dev_by_ssdp.name(), dev_by_ip.name());
    assert_eq!(dev_by_ssdp.name(), dev_by_uuid.name());

    Ok(())
}

Task List

  • Connect
  • Pairing
  • Get device state
  • Virtual remote commands
  • Readable settings
  • Writeable settings
  • Current App
  • App launching
Commit count: 70

cargo fmt