JLChen
2020-06-04 6d55af8792cf8fbef0055e677b900fc352dba9a2
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace Shared
{
    /// <summary>
    /// ¼ÌµçÆ÷
    /// </summary>
    [System.Serializable]
    public class LightSwitch : Common
    {
        public LightSwitch ()
        {
            if (UserConfig.Instance.SocketList.Contains (CommonLoopID) || IsSwitch) {
                Type = DeviceType.LightSwitchSocket;
                DeviceTextID = 265; //SimpleControl.R.MyInternationalizationString.ElectricalControl;
            } else {
                this.Type = DeviceType.LightSwitch;
                DeviceTextID = 3; //SimpleControl.R.MyInternationalizationString.Lights;
            }
        }
 
        /// <summary>
        /// µ±Ç°×´Ì¬
        /// </summary>
        //public ONorOFF Status = ONorOFF.OFF;
        public byte CurrentBrightness = 0;
 
        /// <summary>
        /// ÑÓʱʱ¼ä¸ßλ
        /// </summary>
        public byte DelayTimeHeight = 0;
 
        /// <summary>
        /// ÑÓʱʱ¼äµÍλ
        /// </summary>
        public byte DelayTimeLow = 0;
        [Newtonsoft.Json.JsonIgnore]
        /// <summary>
        /// ×Ô¶¨ÒåÊôÐÔ
        /// ÊÇ·ñÊDzå×ù
        /// </summary>
        public bool IsSocket {
            get {
                bool issocket = UserConfig.Instance.SocketList.Contains (CommonLoopID);
                if (issocket)
                    return issocket;
                return IsSwitch;
            }
        }
 
        bool IsSwitch;
    }
}