Files
Evergreen-Health/Evergreen.Health.Application/Health/Integrations/HomeAssistant/HomeAssistantOptions.cs
T
2026-11-09 16:10:05 +08:00

65 lines
3.0 KiB
C#

using Furion.ConfigurableOptions;
namespace Evergreen.Health.Application.Health.Integrations.HomeAssistant;
public sealed class HomeAssistantOptions : IConfigurableOptions
{
public bool Enabled { get; set; } = true;
public string BaseUrl { get; set; } = string.Empty;
public string AccessToken { get; set; } = string.Empty;
public int TimeoutSeconds { get; set; } = 15;
// 匹配已退役设备的明确实体绑定,不按名称或品牌隐藏设备。
public List<string> ExcludedDeviceEntityIds { get; set; } = [];
public HomeAssistantEntityOptions Entities { get; set; } = new();
public HomeAssistantSleepSceneOptions SleepScene { get; set; } = new();
public List<SceneLightOptions> AdditionalSleepLights { get; set; } = [];
}
/// <summary>明确加入舒睡/全关的额外灯具;未配置的灯仍仅提供单独控制。</summary>
public sealed class SceneLightOptions
{
public string Key { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public string EntityId { get; set; } = string.Empty;
public string? SleepEffect { get; set; }
}
public sealed class HomeAssistantEntityOptions
{
public string Climate { get; set; } = string.Empty;
public string Curtain { get; set; } = string.Empty;
public string Outlet { get; set; } = string.Empty;
public string Dehumidifier { get; set; } = string.Empty;
public string DehumidifierFanLevel { get; set; } = string.Empty;
public string DehumidifierUv { get; set; } = string.Empty;
public string FragranceSwitch { get; set; } = string.Empty;
public string FragranceLight { get; set; } = string.Empty;
public string FragranceDuration { get; set; } = string.Empty;
public string FragranceInterval { get; set; } = string.Empty;
public string FragranceQuickRelease { get; set; } = string.Empty;
public string FragranceAutoRelease { get; set; } = string.Empty;
public string FragranceAutoLight { get; set; } = string.Empty;
public string FragranceLightAutoOff { get; set; } = string.Empty;
public string AmbientLight { get; set; } = string.Empty;
public string Speaker { get; set; } = string.Empty;
public string SpeakerSleepMode { get; set; } = string.Empty;
public string Temperature { get; set; } = string.Empty;
public string Humidity { get; set; } = string.Empty;
public string Pm25 { get; set; } = string.Empty;
public string Co2 { get; set; } = string.Empty;
public string Formaldehyde { get; set; } = string.Empty;
public string Tvoc { get; set; } = string.Empty;
}
public sealed class HomeAssistantSleepSceneOptions
{
public int TargetHumidity { get; set; } = 55;
public string DehumidifierMode { get; set; } = "睡眠";
public string FanLevel { get; set; } = "1挡";
public int LightBrightnessPercent { get; set; } = 20;
public int LightColorTemperatureKelvin { get; set; } = 2700;
public bool EnableFragrance { get; set; } = true;
public bool EnableSpeakerSleepMode { get; set; }
public bool EnableUv { get; set; }
}