1
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
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("涂鸦接入仅预留,本版没有发送控制命令");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user