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 deviceList = new List (); /// /// 定时器的唯一ID /// public string id { get; set; } /// /// 用户Id /// public string userId { get; set; } /// /// 定时器备注名 /// public string timerName { get; set; } /// /// 住宅ID /// public string gatewayId { get; set; } /// /// 网关ID /// public string homeId { get; set; } /// /// 执行时间点 /// public string executeUtcTime { get; set; } /// /// 重复周期 /// public List whichDay = new List (); /// /// 是否启用(默认开启) /// public bool isEnable = true; /// /// 定时器重复类型 /// public TimerType timerType { get; set; } /// /// 控制的设备数据 /// public DeviceDate controlData = new DeviceDate (); /// /// 房间名称 /// public string RoomName = "ALL"; /// /// 时区 /// public int TimeZone { get; set; } } public enum TimerType { EveryDay = 0, //每天 WorkingDay = 1, //工作日 Weekend = 2, //周末 Week = 3, //指定星期几 Period, //指定时间段 AppointDay, //指定日 } [Serializable] public class DeviceDate { /// /// 住宅ID /// public string gatewayId { get; set; } /// /// 网关ID /// public string homeId { get; set; } public List actions = new List (); } [Serializable] public class Fun { /// /// 设备ID /// public long deviceId = 0; /// /// 云雀定义spk /// public string spk = string.Empty; /// /// spk(设备)的属性列表 /// public List attributes = new List (); public Bus bus = new Bus (); } [Serializable] public class Attributes { /// /// "key":"on_off", /// public string key = "on_off"; /// /// "value":on/off /// public string value = string.Empty; } [Serializable] public class Bus { public string addresses = string.Empty; public string loopId = string.Empty; } }