Bravia.AvContent (Bravia v0.1.0)

Copy Markdown View Source

Inputs and what is currently playing.

{:ok, inputs} = Bravia.AvContent.get_current_external_inputs_status(tv)
:ok = Bravia.AvContent.set_play_content(tv, "extInput:hdmi?port=4")

Each input reports a "connection" flag, so you can tell which HDMI ports actually have something live on them — useful for checking whether the television is showing the machine you are running on.

Summary

Functions

Lists the external inputs with their labels and connection state.

Reads what is currently playing.

Lists the URI schemes the television understands, such as extInput and tv.

Lists the sources available under a scheme.

Switches to a source by URI, as reported by get_current_external_inputs_status/1.

Functions

get_current_external_inputs_status(client)

@spec get_current_external_inputs_status(Bravia.Client.t()) ::
  {:ok, [map()]} | {:error, Bravia.Error.t()}

Lists the external inputs with their labels and connection state.

Uses version 1.1, which is the one that reports "connection".

[%{"uri" => "extInput:hdmi?port=4", "title" => "HDMI 4",
   "label" => "PC", "connection" => true}, ...]

get_playing_content_info(client)

@spec get_playing_content_info(Bravia.Client.t()) ::
  {:ok, map()} | {:error, Bravia.Error.t()}

Reads what is currently playing.

get_scheme_list(client)

@spec get_scheme_list(Bravia.Client.t()) ::
  {:ok, [map()]} | {:error, Bravia.Error.t()}

Lists the URI schemes the television understands, such as extInput and tv.

get_source_list(client, scheme)

@spec get_source_list(Bravia.Client.t(), String.t()) ::
  {:ok, [map()]} | {:error, Bravia.Error.t()}

Lists the sources available under a scheme.

set_play_content(client, uri)

@spec set_play_content(Bravia.Client.t(), String.t()) ::
  :ok | {:error, Bravia.Error.t()}

Switches to a source by URI, as reported by get_current_external_inputs_status/1.

Bravia.AvContent.set_play_content(tv, "extInput:hdmi?port=4")