85 lines
4.1 KiB
C#
85 lines
4.1 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 bool OnlyConfiguredDevices { get; set; }
|
|
public List<DisplayOnlyDeviceOptions> DisplayOnlyDevices { get; set; } = [];
|
|
// 每条独立灯具登记自己的主 light 实体,名称和可控能力读取自 HA。
|
|
public List<string> ManualLightEntityIds { get; set; } = [];
|
|
public HomeAssistantEntityOptions Entities { get; set; } = new();
|
|
public HomeAssistantSleepSceneOptions SleepScene { get; set; } = new();
|
|
public List<SceneLightOptions> AdditionalSleepLights { get; set; } = [];
|
|
}
|
|
|
|
public sealed class DisplayOnlyDeviceOptions
|
|
{
|
|
public string EntityId { get; set; } = string.Empty;
|
|
public string Name { get; set; } = string.Empty;
|
|
public string Category { get; set; } = "Other";
|
|
}
|
|
|
|
/// <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 bool StartSleepOnManualPowerOn { get; set; } = true;
|
|
}
|
|
|
|
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 WakeFragranceSwitch { get; set; } = string.Empty;
|
|
public string WakeFragranceLight { get; set; } = string.Empty;
|
|
public string WakeFragranceDuration { get; set; } = string.Empty;
|
|
public string WakeFragranceInterval { get; set; } = string.Empty;
|
|
public string WakeFragranceQuickRelease { get; set; } = string.Empty;
|
|
public string WakeFragranceAutoRelease { get; set; } = string.Empty;
|
|
public string WakeFragranceAutoLight { get; set; } = string.Empty;
|
|
public string WakeFragranceLightAutoOff { 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; }
|
|
}
|