Skip to content

Commit

Permalink
💾 Feat(Dashboard): Try to exchange device key actually.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dynesshely committed Mar 2, 2024
1 parent 015743c commit a2408ec
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion KitX Shared/KitX.Shared.CSharp/Device/DeviceLocator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace KitX.Shared.CSharp.Device;
using System;

namespace KitX.Shared.CSharp.Device;

public class DeviceLocator
{
Expand Down Expand Up @@ -33,4 +35,20 @@ public DeviceLocator ResetMacAddress(string mac)
MacAddress = mac;
return this;
}

public override bool Equals(object obj)
{
if (obj is not DeviceLocator target)
throw new InvalidOperationException($"Currently you can not compare {nameof(DeviceLocator)} with other types.");

var result = DeviceName.Equals(target.DeviceName) &&
IPv4.Equals(target.IPv4) &&
IPv6.Equals(target.IPv6) &&
MacAddress.Equals(target.MacAddress)
;

return result;
}

public override int GetHashCode() => base.GetHashCode();
}

0 comments on commit a2408ec

Please sign in to comment.