diff options
author | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2021-10-27 15:47:11 +0300 |
---|---|---|
committer | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2021-10-27 15:47:11 +0300 |
commit | 56ba3bf92decc1fd166d2207bd8326dfc32e2e0a (patch) | |
tree | 53d52cb64f1078197b3dc43bab5aa75e552dc079 /TuyaDeviceScanInfo.cs | |
parent | e7b97d1ba238cfdf0ae7c60b8b21367104ff5e6e (diff) |
API
Diffstat (limited to 'TuyaDeviceScanInfo.cs')
-rw-r--r-- | TuyaDeviceScanInfo.cs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/TuyaDeviceScanInfo.cs b/TuyaDeviceScanInfo.cs new file mode 100644 index 0000000..777b8b9 --- /dev/null +++ b/TuyaDeviceScanInfo.cs @@ -0,0 +1,39 @@ +using System;
+using System.Text.Json.Serialization;
+
+namespace com.clusterrr.TuyaNet
+{
+ public class TuyaDeviceScanInfo : IEquatable<TuyaDeviceScanInfo>
+ {
+ [JsonPropertyName("ip")]
+ public string IP { get; set; } = null;
+
+ [JsonPropertyName("gwId")]
+ public string GwId { get; set; } = null;
+
+ [JsonPropertyName("active")]
+ public int Active { get; set; } = 0;
+
+ [JsonPropertyName("ability")]
+ public int Ability { get; set; } = 0;
+
+ [JsonPropertyName("mode")]
+ public int Mode { get; set; } = 0;
+
+ [JsonPropertyName("encrypt")]
+ public bool Encryption { get; set; } = false;
+
+ [JsonPropertyName("productKey")]
+ public string ProductKey { get; set; } = null;
+
+ [JsonPropertyName("version")]
+ public string Version { get; set; } = null;
+
+ public bool Equals(TuyaDeviceScanInfo other)
+ => (IP == other.IP) && (GwId == other.GwId);
+
+ public override string ToString()
+ => $"IP: {IP}, gwId: {GwId}, product key: {ProductKey}, encryption: {Encryption}, version: {Version}";
+ }
+
+}
|