feat: add device relay and telemetry support

This commit is contained in:
2026-09-03 07:49:10 +03:30
parent 9eaa5b70d1
commit 6297df7dfd
18 changed files with 2077 additions and 20 deletions

View File

@@ -0,0 +1,35 @@
using Domain = GreenHome.Domain;
namespace GreenHome.Application;
/// <summary>
/// تنظیمات یک رله دستگاه
/// </summary>
public sealed class DeviceRelayDto
{
public int Id { get; set; }
public int DeviceSettingsId { get; set; }
public int RelayIndex { get; set; }
public string Name { get; set; } = string.Empty;
public bool IsEnabled { get; set; } = true;
public Domain.RelayKind RelayKind { get; set; } = Domain.RelayKind.Generic;
public Domain.RelayMode Mode { get; set; } = Domain.RelayMode.Auto;
public int MinOnMinutes { get; set; } = 0;
public int MinOffMinutes { get; set; } = 0;
public List<DeviceRelayRuleDto> Rules { get; set; } = new();
}
/// <summary>
/// قانون روشن/خاموش شدن رله
/// </summary>
public sealed class DeviceRelayRuleDto
{
public int Id { get; set; }
public Domain.SensorType SensorType { get; set; }
public Domain.ComparisonType ComparisonType { get; set; }
public decimal Value1 { get; set; }
public decimal? Value2 { get; set; }
public Domain.RelayAction Action { get; set; } = Domain.RelayAction.On;
public Domain.AlertTimeType TimeType { get; set; } = Domain.AlertTimeType.Always;
public int Order { get; set; }
}