Class Scene
- Namespace
- HaMqttDiscoverable.Entities
- Assembly
- HaMqttDiscoverable.dll
A stateless scene Home Assistant can activate, e.g. "Movie Night".
public sealed class Scene : HaEntity<SceneConfig>, IAsyncDisposable
- Inheritance
-
Scene
- Implements
- Inherited Members
Constructors
Scene(HaMqttConnection, SceneConfig, Func<Task>?)
Creates a scene from the given config, optionally subscribing onActivated to Activated.
public Scene(HaMqttConnection connection, SceneConfig config, Func<Task>? onActivated = null)
Parameters
connectionHaMqttConnectionconfigSceneConfigonActivatedFunc<Task>
Properties
HasStateTopic
Whether this entity type reports a state at all. Stateless entities like Button override this to false.
protected override bool HasStateTopic { get; }
Property Value
SupportsCommands
Whether this entity type accepts commands from Home Assistant (e.g. switches, numbers). Sensors are read-only and return false.
protected override bool SupportsCommands { get; }
Property Value
Methods
OnCommandReceivedAsync(string)
Called with the raw payload every time a message arrives on CommandTopic. Overridden by controllable entity types.
protected override Task OnCommandReceivedAsync(string payload)
Parameters
payloadstring
Returns
Events
Activated
Raised whenever Home Assistant activates this scene.
public event Func<Task>? Activated