Bravia.Video (Bravia v0.1.0)

Copy Markdown View Source

Picture settings.

{:ok, 15} = Bravia.Video.get_brightness(tv)
:ok = Bravia.Video.set_brightness(tv, 8)

Two things worth knowing before changing anything

Settings are stored per input and per picture mode. A write lands in whichever slot is active at the time and stays there — nothing reverts it when the television is switched off. Read the current value first if you intend to restore it.

Valid ranges differ between models, so they are not enforced here beyond rejecting values that are never valid. Ask the television what it accepts:

{:ok, targets} = Bravia.Video.get_picture_quality_settings(tv, "brightness")
#=> [%{"candidate" => [%{"min" => 0, "max" => 50, "step" => 1}], ...}]

On OLED sets there is no separate backlight control — brightness is the panel luminance.

Summary

Functions

Reads the current brightness.

Reads the current contrast.

Sets the brightness.

Sets the contrast.

Selects a picture mode, such as :game, :cinema, or :standard.

Writes one or more picture settings in a single call.

Types

setting()

@type setting() :: %{target: String.t(), value: String.t()}

Functions

get_brightness(client)

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

Reads the current brightness.

get_contrast(client)

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

Reads the current contrast.

get_picture_quality_settings(client, target \\ "")

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

Reads picture settings.

With no target, returns every adjustable setting the television reports, each with its current value and the values it will accept. Pass a target name to narrow it.

set_brightness(client, value)

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

Sets the brightness.

On OLED televisions this is the panel luminance. The upper bound is model-specific; see the module documentation for reading it from the set.

set_contrast(client, value)

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

Sets the contrast.

set_picture_mode(client, mode)

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

Selects a picture mode, such as :game, :cinema, or :standard.

Which modes exist varies by model; read them from get_picture_quality_settings/2's pictureMode candidates.

set_picture_quality_settings(client, settings)

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

Writes one or more picture settings in a single call.

Bravia.Video.set_picture_quality_settings(tv, [
  %{target: "brightness", value: "5"},
  %{target: "contrast", value: "80"}
])