20 lines
765 B
C#
20 lines
765 B
C#
namespace Evergreen.Health.Application.Health.Integrations.Tuya;
|
|
|
|
/// <summary>未来独立涂鸦模块使用本接口,不要求经过 Home Assistant。</summary>
|
|
public sealed record TuyaCapabilityWrite(string DeviceId, string Code, object? Value);
|
|
public interface ITuyaGateway
|
|
{
|
|
bool IsConfigured { get; }
|
|
Task WriteAsync(TuyaCapabilityWrite command, CancellationToken cancellationToken);
|
|
}
|
|
|
|
public sealed class ReservedTuyaGateway : ITuyaGateway
|
|
{
|
|
public bool IsConfigured => false;
|
|
public Task WriteAsync(TuyaCapabilityWrite command, CancellationToken cancellationToken)
|
|
{
|
|
cancellationToken.ThrowIfCancellationRequested();
|
|
throw new NotSupportedException("涂鸦接入仅预留,本版没有发送控制命令");
|
|
}
|
|
}
|