Creado apartir del commit b888de6c92056de294456f581a56e25e734d4ab7 de develop

This commit is contained in:
jrojas
2026-06-26 09:52:35 +02:00
commit 319fd3dfb0
746 changed files with 106610 additions and 0 deletions
@@ -0,0 +1,55 @@
using adas_core.Domain.Enums;
using MongoDB.Bson;
using Newtonsoft.Json;
namespace adas_core.Domain.Models.MongoModels;
public class Relay
{
public ObjectId Id { get; set; }
public RelayEnum.Type Type { get; set; } = RelayEnum.Type.Door;
public string? Driver { get; init; }
public string Ip { get; init; } = string.Empty;
public int Port { get; init; }
public int RelayNumber { get; init; } = 1;
public string? RelayName { get; init; }
public int Total { get; init; } = 1;
public int RefreshTime { get; set; } = 60;
public bool Open { get; set; }
public RelayEnum.Status Status { get; set; } = RelayEnum.Status.NotInitialized;
public string? Username { get; init; }
public string? Password { get; init; }
public RelayEnum.Mode Mode { get; set; } = RelayEnum.Mode.OpenedOnClosedOff;
public int? RebootDelay { get; set; }
public bool Cache { get; set; } = true;
public bool InUse { get; private set; }
public RelayEnum.Status? ManualRelayStatus { get; set; }
public bool Equals(Relay other)
{
return Driver == other.Driver && Ip == other.Ip && Port == other.Port && RelayNumber == other.RelayNumber &&
RelayName == other.RelayName && Total == other.Total && Username == other.Username &&
Password == other.Password;
}
public override string ToString()
{
return JsonConvert.SerializeObject(this);
}
}