Welcome to mirror list, hosted at ThFree Co, Russian Federation.

TuyaDeviceScanInfo.cs - github.com/ClusterM/tuyanet.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6c513a2df4b00d64917dfb09bf163c49b4bafe29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using Newtonsoft.Json;
using System;

namespace com.clusterrr.TuyaNet
{
    /// <summary>
    /// Device info received from local network.
    /// </summary>
    public class TuyaDeviceScanInfo : IEquatable<TuyaDeviceScanInfo>
    {
        [JsonProperty("ip")]
        public string IP { get; set; } = null;

        [JsonProperty("gwId")]
        public string GwId { get; set; } = null;

        [JsonProperty("active")]
        public int Active { get; set; } = 0;

        [JsonProperty("ability")]
        public int Ability { get; set; } = 0;

        [JsonProperty("mode")]
        public int Mode { get; set; } = 0;

        [JsonProperty("encrypt")]
        public bool Encryption { get; set; } = false;

        [JsonProperty("productKey")]
        public string ProductKey { get; set; } = null;

        [JsonProperty("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}";
    }

}