norcino / BraviaControl

Sony BRAVIA remote control API client for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BraviaControl

Sony BRAVIA remote control API client for .NET

Supported Device

  • Sony BRAVIA 4K (2015) / Android TV

Client Requirement

  • .NET Framework 4.6

Install

Install-Package BraviaControl

Samples

Usage

1. Create a API client.

var client = new BraviaControlClient(
        "Your BRAVIA IP Address",
        "ClientID (ex. GUID)",
        $"{Environment.MachineName} (LINQPad)", // specify friendly "display" name on BRAVIA
        "" // AuthKey. If the client isn't authorized, you can pass empty string.
    );

2. Register your client to BRAVIA: Request PIN code

await client.RequestPinAsync();

3. Register your client to BRAVIA: Input and send PIN code

var pinCode = Console.ReadLine();
var authKey = await client.RegisterAsync(pinCode); // You can store AuthKey for next time use.

4. Send IRCC (Keycode) to BRAVIA

await client.SendIrccAsync(RemoteControllerKeys.TvPower); // TV Power Button (On/Off)
await client.SendIrccAsync(RemoteControllerKeys.VolumeUp); // Volume Up
await client.SendIrccAsync(RemoteControllerKeys.Confirm); // Same as "Enter Button"
await client.SendIrccAsync(RemoteControllerKeys.Return); // Same as "Back Button"

5. Get the BRAVIA's information

// Power status
await client.System.GetPowerStatusAsync();

// ISDBT Channels
await client.AvContent.GetContentListAsync("tv:isdbt", 0, 100, "");
await client.AvContent.SetPlayContentAsync(x.Uri); // select a channel.

// Android applications
await client.AppControl.GetApplicationListAsync();
await client.AppControl.SetActiveAppAsync(x.Uri, x.Data); // open a application.

About

Sony BRAVIA remote control API client for .NET

License:MIT License


Languages

Language:C# 100.0%