Table of Contents

Class LightConfig

Namespace
HaMqttDiscoverable.Entities
Assembly
HaMqttDiscoverable.dll

Configuration for a Light entity. Uses Home Assistant's MQTT JSON light schema, so state and commands are exchanged as small JSON objects rather than plain strings.

public sealed class LightConfig : EntityConfig
Inheritance
LightConfig
Inherited Members

Properties

BrightnessScale

The maximum brightness value accepted/reported, e.g. 255 (the default) or 100.

[JsonPropertyName("brightness_scale")]
public int? BrightnessScale { get; set; }

Property Value

int?

Component

The MQTT component Home Assistant should treat this entity as, e.g. sensor or switch. Used to build the discovery topic; not part of the discovery payload itself.

public override string Component { get; }

Property Value

string

Optimistic

When true, Home Assistant assumes a command succeeded and updates the UI immediately instead of waiting for a state update.

[JsonPropertyName("optimistic")]
public bool? Optimistic { get; set; }

Property Value

bool?

SupportsBrightness

Whether this light supports adjustable brightness.

[JsonPropertyName("brightness")]
public bool SupportsBrightness { get; set; }

Property Value

bool