CrabtreeOn,印度客户定制APP,迁移2.0平台版本
JLChen
2021-03-29 383e792a45268d220cb0e2bf1e9823ba451c428f
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
using System;
using Shared.SimpleControl;
using System.Collections.Generic;
 
namespace Shared
{
    [Serializable]
    public class Timer
    {
        //public string RequestVersion = MainPage.RequestVersion;
 
        //public string RequestSource = MainPage.RequestSource;
 
        public static List<Function> deviceList = new List<Function> ();
 
        /// <summary>
        /// 定时器的唯一ID
        /// </summary>
        public string id { get; set; }
        /// <summary>
        /// 用户Id
        /// </summary>
        public string userId { get; set; }
        /// <summary>
        /// 定时器备注名
        /// </summary>
        public string timerName { get; set; }
 
        /// <summary>
        /// 住宅ID
        /// </summary>
        public string gatewayId { get; set; }
        /// <summary>
        /// 网关ID
        /// </summary>
        public string homeId { get; set; }
 
        /// <summary>
        /// 执行时间点
        /// </summary>
        public string executeUtcTime { get; set; }
 
        /// <summary>
        /// 重复周期
        /// </summary>
        public List<int> whichDay = new List<int> ();
 
        /// <summary>
        /// 是否启用(默认开启)
        /// </summary>
        public bool isEnable = true;
 
        /// <summary>
        /// 定时器重复类型
        /// </summary>
        public TimerType timerType { get; set; }
 
        /// <summary>
        /// 控制的设备数据
        /// </summary>
        public DeviceDate controlData = new DeviceDate ();
 
        /// <summary>
        /// 房间名称
        /// </summary>
        public string RoomName = "ALL";
 
        /// <summary>
        /// 时区
        /// </summary>
        public int TimeZone { get; set; }
 
    }
 
    public enum TimerType
    {
        EveryDay = 0,   //每天
        WorkingDay = 1, //工作日
        Weekend = 2,    //周末
        Week = 3,       //指定星期几
        Period,     //指定时间段
        AppointDay,  //指定日
 
    }
 
 
    [Serializable]
    public class DeviceDate
    {
 
        /// <summary>
        /// 住宅ID
        /// </summary>
        public string gatewayId { get; set; }
        /// <summary>
        /// 网关ID
        /// </summary>
        public string homeId { get; set; }
 
        public List<Fun> actions = new List<Fun> ();
    }
    [Serializable]
    public class Fun
    {
        /// <summary>
        /// 设备ID
        /// </summary>
        public long deviceId = 0;
        /// <summary>
        /// 云雀定义spk
        /// </summary>
        public string spk = string.Empty;
        /// <summary>
        /// spk(设备)的属性列表
        /// </summary>
        public List<Attributes> attributes = new List<Attributes> ();
        public Bus bus = new Bus ();
    }
    [Serializable]
    public class Attributes
    {
       
        /// <summary>
        ///  "key":"on_off",
        /// </summary>
        public string key = "on_off";
        /// <summary>
        /// "value":on/off
        /// </summary>
        public string value = string.Empty;
    }
    [Serializable]
    public class Bus
    {
        public string addresses = string.Empty;
        public string loopId = string.Empty;
    }
 
 
}