HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-09-22 ade5917841b0fdcb1df7353ef7c56b1a1bdc9282
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
using System;
using System.Collections.Generic;
 
namespace Shared.Common
{
 
    public class Logic
    {
        public static List<Logic> LogicList = new List<Logic>();
        public static List<Logic> LockLogicList = new List<Logic>();
        public static List<Logic> SoneLogicList = new List<Logic>();
        public static List<ZigBee.Device.CommonDevice> LogicDviceList = new List<ZigBee.Device.CommonDevice>();
        public static Logic CurrentLogic;
        /// <summary>
        ///0:获取成功
        ///<para>1:该逻辑不存在。</para>
        ///<para>以下所有字段只有在Result 为1时存在</para>
        /// </summary>
        public int Result;
        /// <summary>
        /// 0.正常自动化;1.门锁自动化;2.门锁常开.关;
        /// </summary>
        public int LogicType = 0;
        /// <summary>
        /// 逻辑ID
        /// </summary>
        public int LogicId;
        /// <summary>
        ///该逻辑是否被使能。 
        ///<para>0:禁用该逻辑</para>
        ///<para>1:使能该逻辑</para>
        ///<para>2: 只触发一次。触发后该字段将自动置为0,即禁用状态。</para>
        /// </summary>
        public int IsEnable;
 
        /// <summary>
        ///逻辑名称
        /// </summary>
        public string LogicName;
 
        /// <summary>
        ///逻辑关系。
        ///<para>0:满足所有条件触发动作</para>
        ///<para>1:满足其中一个条件触发动作</para>
        /// </summary>
        public int Relationship;
        /// <summary>
        /// 推送内容
        /// </summary>
        public string LogicCustomPushText=string.Empty;
        /// <summary>
        /// 记录推送开关状态
        /// </summary>
        public int LogicIsCustomPushText = 0;
 
        //public Dictionary<string, string> TimeAttribute = new Dictionary<string, string>();
        public TimeAttributeObj TimeAttribute = new TimeAttributeObj();
        /// <summary>
        /// 逻辑条件列表
        /// </summary>
        public List<Dictionary<string, string>> Conditions = new List<Dictionary<string, string>>();
 
        /// <summary>
        /// 条件满足后执行的动作列表
        /// </summary>
        public List<Dictionary<string, object>> Actions = new List<Dictionary<string, object>>();
 
        /// <summary>
        /// 关联app账号列表
        /// </summary>
        public List<Dictionary<string, string>> Accounts = new List<Dictionary<string, string>>();
 
    }
 
    /// <summary>
    /// 描述逻辑时间属性
    /// </summary>
    [System.Serializable]
    public class TimeAttributeObj
    {
        public int Calendar;
        public int Repeat = 2;
        public int WeekDay;
        public int SetYear;
        public int MonthDate;
        public int SelectMonth;
        public List<int> SelectMonDate = new List<int>();
    }
 
 
}