Class FanConfig
- Namespace
- HaMqttDiscoverable.Entities
- Assembly
- HaMqttDiscoverable.dll
Configuration for a Fan entity: on/off, optionally with speed (SupportsPercentage) and/or named presets (PresetModes). Oscillation and direction control aren't exposed yet - see Fan's remarks.
public sealed class FanConfig : EntityConfig
- Inheritance
-
FanConfig
- Inherited Members
Properties
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
PayloadOff
The payload sent/expected to mean "off". Defaults to "OFF".
[JsonPropertyName("payload_off")]
public string PayloadOff { get; set; }
Property Value
PayloadOn
The payload sent/expected to mean "on". Defaults to "ON".
[JsonPropertyName("payload_on")]
public string PayloadOn { get; set; }
Property Value
PresetModes
The list of named presets this fan supports (e.g. "eco", "sleep", "auto"). When non-empty, a preset mode command/state topic pair is added - see PresetModeCommandReceived.
[JsonIgnore]
public List<string> PresetModes { get; set; }
Property Value
SpeedRangeMax
The highest speed step. Defaults to 100.
[JsonPropertyName("speed_range_max")]
public int SpeedRangeMax { get; set; }
Property Value
SpeedRangeMin
The lowest non-zero speed step, e.g. 1 (the default) for a percentage-based fan, or the number of discrete speeds otherwise.
[JsonPropertyName("speed_range_min")]
public int SpeedRangeMin { get; set; }
Property Value
SupportsPercentage
When true, this fan reports/accepts a speed percentage in addition to on/off.
[JsonIgnore]
public bool SupportsPercentage { get; set; }