ThinkingHome.DeviceModel.Drivers.Stubs
ThinkingHome.DeviceModel.Drivers.Stubs
StubColorTemperatureLamp Class
Заглушка лампы с регулировкой цветовой температуры (OnOff + яркость + температура).
public sealed class StubColorTemperatureLamp : ThinkingHome.DeviceModel.IDeviceInheritance System.Object → StubColorTemperatureLamp
Implements IDevice
Constructors
StubColorTemperatureLamp(string, StubDeviceConfig) Constructor
Заглушка лампы с регулировкой цветовой температуры (OnOff + яркость + температура).
public StubColorTemperatureLamp(string id, ThinkingHome.DeviceModel.Drivers.Stubs.StubDeviceConfig config);Parameters
config StubDeviceConfig
Properties
StubColorTemperatureLamp.Id Property
Стабильный идентификатор устройства.
public string Id { get; }Implements Id
Property Value
Methods
StubColorTemperatureLamp.Describe() Method
Описание устройства (discovery).
public ThinkingHome.DeviceModel.DeviceDescriptor Describe();Implements Describe()
Returns
StubColorTemperatureLamp.ExecuteAsync(DeviceCommand, CancellationToken) Method
Исполнить команду (execute). Незнакомую команду вернуть как Unsupported.
public System.Threading.Tasks.Task<ThinkingHome.DeviceModel.CommandOutcome> ExecuteAsync(ThinkingHome.DeviceModel.Commands.DeviceCommand command, System.Threading.CancellationToken ct=default(System.Threading.CancellationToken));Parameters
command DeviceCommand
ct System.Threading.CancellationToken
Implements ExecuteAsync(DeviceCommand, CancellationToken)
Returns
System.Threading.Tasks.Task<CommandOutcome>
StubColorTemperatureLamp.QueryAsync(CancellationToken) Method
Опросить текущее состояние (query).
public System.Threading.Tasks.Task<ThinkingHome.DeviceModel.State.DeviceSnapshot> QueryAsync(System.Threading.CancellationToken ct=default(System.Threading.CancellationToken));Parameters
ct System.Threading.CancellationToken
Implements QueryAsync(CancellationToken)
Returns
System.Threading.Tasks.Task<DeviceSnapshot>
Events
StubColorTemperatureLamp.Changed Event
Изменение состояния (report/push).
public event Action<StateChange>? Changed;Implements Changed