Table of Contents

Class MediaPlayerConfig

Namespace
HaMqttDiscoverable.Entities
Assembly
HaMqttDiscoverable.dll

Configuration for a MediaPlayer. Unlike other entity configs, this isn't a single Home Assistant component - it describes the bundle of real MQTT entities (switch, number, select, sensors, buttons) that MediaPlayer creates.

public sealed class MediaPlayerConfig
Inheritance
MediaPlayerConfig
Inherited Members

Properties

Device

The device this media player belongs to. Required.

public Device Device { get; set; }

Property Value

Device

Name

The base name for the media player, e.g. "Living Room TV". Combined with each sub-entity's short name (e.g. "Power", "Volume") the same way Name is elsewhere in this library.

public string Name { get; set; }

Property Value

string

Sources

The list of selectable input sources, e.g. ["HDMI 1", "HDMI 2", "Chromecast"]. When empty (the default), no Source entity is created.

public List<string> Sources { get; set; }

Property Value

List<string>

SupportsMute

When true, a mute Mute switch is created in addition to the power switch.

public bool SupportsMute { get; set; }

Property Value

bool

UniqueId

The base unique id for the media player. Each sub-entity gets its own unique id derived from this (e.g. "{UniqueId}_power"). Required.

public string UniqueId { get; set; }

Property Value

string

VolumeMax

The maximum value reported/accepted by Volume. Defaults to 1, matching Home Assistant's own 0.0-1.0 volume_level convention - keep this at 1 unless you have a specific reason to use a different scale (e.g. 0-100), since Home Assistant's "Universal Media Player" reads this value directly with no conversion.

public double VolumeMax { get; set; }

Property Value

double

VolumeMin

The minimum value reported/accepted by Volume. Defaults to 0.

public double VolumeMin { get; set; }

Property Value

double

VolumeStep

The step between selectable volume values. Defaults to 0.01.

public double VolumeStep { get; set; }

Property Value

double