namespace GreenHome.Application;
///
/// DTO for relay conditions sent to the device firmware.
///
public sealed class RelayConditionDto
{
public int Enabled { get; set; }
/// شناسه رله برای سازگاری با فریمور قبلی (مثلاً R1)
public string Relay { get; set; } = string.Empty;
/// شماره رله (۱ تا RelayCount)
public int RelayIndex { get; set; }
/// نام نمایشی رله (فن، هیتر و ...)
public string Name { get; set; } = string.Empty;
/// گروههای روشن شدن (OR بین گروهها)
public List On { get; set; } = new();
/// گروههای خاموش شدن (OR بین گروهها)
public List Off { get; set; } = new();
}
///
/// یک گروه شرط (AND داخل گروه)
///
public sealed class RelayGroupDto
{
/// برچسب اختیاری گروه برای لاگ/اعلان
public string? Label { get; set; }
public List Conditions { get; set; } = new();
}
///
/// یک شرط واحد: سنسوری (Kind=0) یا زمانی (Kind=1)
///
public sealed class RelayRuleDto
{
/// نوع شرط: 0 = سنسوری، 1 = زمانی
public int Kind { get; set; }
// سنسوری
public int? Sensor { get; set; }
public int? Op { get; set; }
public decimal? V1 { get; set; }
public decimal? V2 { get; set; }
// زمانی (دقیقه از نیمهشب)
public int? Start { get; set; }
public int? End { get; set; }
}