CrabtreeOn,印度客户定制APP,迁移2.0平台版本
1
wxr
2023-03-31 d53e6af2c5f17838fa79659614b15a2a1f383399
Crabtree/SmartHome/HDL/Operation/ResponseEntity/Timer.cs
@@ -1,19 +1,86 @@
using System;
using Shared.SimpleControl;
using System.Collections.Generic;
namespace Shared
{
    [Serializable]
    public class Timer
    {
        public string RequestVersion = MainPage.RequestVersion;
        //public string RequestVersion = MainPage.RequestVersion;
        public string RequestSource = MainPage.RequestSource;
        //public string RequestSource = MainPage.RequestSource;
        public static List<Function> deviceList = new List<Function> ();
        /// <summary>
        /// 定时器的唯一ID
        /// </summary>
        public string Id { get; set; }
        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; }
    }
    /// <summary>
    /// 旧服务器迁移过来的对象
    /// </summary>
    [Serializable]
    public class Timer_Old
    {
        /// <summary>
        /// 定时器的唯一ID
        /// </summary>
        public string Guid { get; set; }
        /// <summary>
        /// 定时器备注名
@@ -23,7 +90,7 @@
        /// <summary>
        /// 网关ID
        /// </summary>
        public string RegionID { get; set; }
        public int RegionID { get; set; }
        /// <summary>
        /// 执行时间点
@@ -48,7 +115,7 @@
        /// <summary>
        /// 控制的设备数据
        /// </summary>
        public string ControlDeviceData ="";
        public string ControlDeviceData = "";
        /// <summary>
        /// 房间名称
@@ -65,15 +132,72 @@
    public enum TimerType
    {
        EveryDay = 0,   //每天
        WorkingDay, //工作日
        Weekend,    //周末
        Week,       //指定星期几
        WorkingDay = 1, //工作日
        Weekend = 2,    //周末
        Week = 3,       //指定星期几
        Period,     //指定时间段
        AppointDay,  //指定日
    }
    #region 通讯
    [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;
    }
    /// <summary>
    /// 旧平台定时器的控制数据
    /// </summary>
    public class DeviceInfo
    {
        public string DevicePath { get; set; }
@@ -98,22 +222,7 @@
        }
        public string Name;
    }
    //    AddTimer 添加定时器
    //当定时器重复类型为每日、工作日、周末,只填充TimerType
    //如果未指定星期几Week,填充Periodicity
    //    EditTimer 编辑定时器
    //当定时器重复类型为每日、工作日、周末,只填充TimerType
    //如果未指定星期几Week,填充Periodicity
    //GetOneTimerInfo 读取一个定时器信息
    //填充Id 字段就行了
    //GetTimerList 读取定时器列表    填充 GatewayId字段
    //IsEnableTimer 启用或禁用定时器    填充Id 字段就行了
    //DeleteTimer 删除定时器    填充Id 字段就行了
    #endregion
}