This commit is contained in:
fuenmao
2026-10-09 16:46:30 +08:00
parent 4a634ef4c2
commit e6b90a06ab
63 changed files with 4170 additions and 1518 deletions
@@ -0,0 +1,25 @@
using Evergreen.Health.Application.Health.Integrations.HomeAssistant;
using Evergreen.Health.Application.Health.Models;
using Evergreen.Health.Application.Health.Scenes;
namespace Evergreen.Health.Application.Health.Devices.Contracts;
/// <summary>新增家具实现此契约并注册即可;场景和 API 不枚举具体家具类型。</summary>
public interface IHealthDeviceModule
{
string Key { get; }
string Category { get; }
string DisplayName { get; }
string PrimaryEntityId { get; }
bool PowerUsesIndependentGateway { get; }
IReadOnlyList<DeviceParameterDefinition> Parameters { get; }
IEnumerable<string> EntityIds { get; }
DeviceCommand BuildParameterCommand(string parameterType, object? value);
Task ExecuteParameterAsync(DeviceCommand command, CancellationToken cancellationToken);
bool ParameterUsesIndependentGateway(DeviceCommand command);
Task SetPowerAsync(bool turnOn, CancellationToken cancellationToken);
Task ExecuteSleepAsync(DeviceSceneContext context, PersonalizedSceneConfig config,
string constitutionCode, CancellationToken cancellationToken);
IEnumerable<DeviceCommand> GetShutdownCommands();
HomeAssistantScenePresetItem? BuildPreview(PersonalizedSceneConfig config, string constitutionCode);
}