545 lines
22 KiB
C#
545 lines
22 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
|
|||
|
|
namespace Domain.IoTXiaoDuEntity
|
|||
|
|
{
|
|||
|
|
public class Header
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 消息的唯一标识符,长度小于128个字符。messageId仅用于标识消息,无其他使用。建议使用随机生成的UUID作为messageId。
|
|||
|
|
/// </summary>
|
|||
|
|
public string messageId { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 指令的类别。 目前支持的类别有:DuerOS.ConnectedHome.Discovery:发现设备指令。DuerOS.ConnectedHome.Control:控制设备指令。DuerOS.ConnectedHome.Query:查询设备指令。
|
|||
|
|
/// </summary>
|
|||
|
|
public string @namespace { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 指令的名称。
|
|||
|
|
/// </summary>
|
|||
|
|
public string name { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// payload的版本号。
|
|||
|
|
/// </summary>
|
|||
|
|
public string payloadVersion { get; set; }
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 表示设备定时设置的值,它指定一个数字,代表时间戳,单位是秒。
|
|||
|
|
/// </summary>
|
|||
|
|
public class Timestamp
|
|||
|
|
{
|
|||
|
|
//public double value { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 定时:每天
|
|||
|
|
/// </summary>
|
|||
|
|
public string raw { get; set; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public class Value
|
|||
|
|
{
|
|||
|
|
public string timePoint { get; set; }
|
|||
|
|
public string cycle { get; set; }
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备的亮度
|
|||
|
|
/// </summary>
|
|||
|
|
public class Brightness
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 灯光亮度的百分比值,是double类型,取值范围为0~100。其中0表示灯在打开时的最小亮度,100表示灯的最大亮度。
|
|||
|
|
/// </summary>
|
|||
|
|
public double value { get; set; }
|
|||
|
|
}
|
|||
|
|
public class RGBValue
|
|||
|
|
{
|
|||
|
|
public LightingRgb value { get; set; }
|
|||
|
|
}
|
|||
|
|
public class LightingRgb
|
|||
|
|
{
|
|||
|
|
public string r { get; set; }
|
|||
|
|
public string g { get; set; }
|
|||
|
|
public string b { get; set; }
|
|||
|
|
}
|
|||
|
|
public class DeltaPercentage
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 亮度增加的百分比值,是float类型,取值范围是0~100。
|
|||
|
|
/// </summary>
|
|||
|
|
public float value { get; set; }
|
|||
|
|
}
|
|||
|
|
public class DeltaValue
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备调整温度值,是float类型。
|
|||
|
|
/// </summary>
|
|||
|
|
public string value { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 温度计量单位。有CELSIUS(摄氏温度)和FAHRENHEIT(华氏温度)两种计量单位,默认使用CELSIUS。
|
|||
|
|
/// </summary>
|
|||
|
|
public string scale { get; set; }
|
|||
|
|
}
|
|||
|
|
public class Color
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 灯光设置的色相,是double类型,取值范围为0.00〜360.00。
|
|||
|
|
/// </summary>
|
|||
|
|
public double hue { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 灯光设置饱和度,是double类型,取值范围为0.0000〜1.0000。
|
|||
|
|
/// </summary>
|
|||
|
|
public double saturation { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 灯光设置的亮度,是double类型,取值范围为0.0000〜1.0000。
|
|||
|
|
/// </summary>
|
|||
|
|
public double brightness { get; set; }
|
|||
|
|
}
|
|||
|
|
public class TargetTemperature
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备设定的目标温度值。
|
|||
|
|
/// </summary>
|
|||
|
|
public string value { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 温度计量单位。有CELSIUS(摄氏温度)和FAHRENHEIT(华氏温度)两种计量单位,默认使用CELSIUS。
|
|||
|
|
/// </summary>
|
|||
|
|
public string scale { get; set; }
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 温度设定之前的设备模式。
|
|||
|
|
/// </summary>
|
|||
|
|
public class Mode
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备类型
|
|||
|
|
/// </summary>
|
|||
|
|
public string deviceType { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备模式,与设备类型相关,不同设备类型的模式不同
|
|||
|
|
/// </summary>
|
|||
|
|
public string value { get; set; }
|
|||
|
|
}
|
|||
|
|
public class Temperature
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 温度设定之前设备的温度,是double类型。
|
|||
|
|
/// </summary>
|
|||
|
|
public double value { get; set; }
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备的风速对象,包含一个属性值value或者一个属性值level,取决于用户自然表达。
|
|||
|
|
/// </summary>
|
|||
|
|
public class FanSpeed
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备的风速值,是int类型,取值范围是1~10。用户表达具体风速值时,会出该字段。
|
|||
|
|
/// </summary>
|
|||
|
|
public int value { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备的风速档位级别,是string类型,取值范围是(min、low、middle、high、max、auto))。用户表达风速级别时,会出该字段。
|
|||
|
|
/// </summary>
|
|||
|
|
public string level { get; set; }
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备移动方向信息。
|
|||
|
|
/// </summary>
|
|||
|
|
public class Direction
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 方向设置值的列表,目前支持的值有:FORWARD:向前,BACKWARD:向后,LEFT:向左,RIGHT:向右,CLOCKWISE:顺时针转,COUNTERCLOCKWISE:逆时针转
|
|||
|
|
/// </summary>
|
|||
|
|
public string value { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 方向类型,目前支持的值有:MOVE:移动,BLOW:吹风,SWING:摇摆
|
|||
|
|
/// </summary>
|
|||
|
|
public string type { get; set; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public class Request
|
|||
|
|
{
|
|||
|
|
public class Appliance
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备标识符。标识符在用户拥有的所有设备上必须是唯一的。此外,标识符需要在同一设备的多个发现请求之间保持一致。标识符可以包含任何字母或数字和以下特殊字符:_ - = # ; : ? @ &。标识符不能超过256个字符。
|
|||
|
|
/// </summary>
|
|||
|
|
public string applianceId { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 提供给设备云使用,存放设备或场景相关的附加信息,是键值对。DuerOS不解析或使用这些数据。该属性的内容不能超过5000字节。
|
|||
|
|
/// </summary>
|
|||
|
|
public Dictionary<string, string> additionalApplianceDetails { get; set; }
|
|||
|
|
}
|
|||
|
|
public class Payload
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备云端获取的access token。
|
|||
|
|
/// </summary>
|
|||
|
|
public string accessToken { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 被授权的百度账号开放ID,与设备云账号一一对应。设备云端需要将该字段与用户账号一一对应起来存储,其它协议中如果需要携带openUid字段时,则需要返回用户账号对应的openUid值。
|
|||
|
|
/// </summary>
|
|||
|
|
public string openUid { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 客房音箱设备序列码
|
|||
|
|
/// </summary>
|
|||
|
|
public string cuid { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 自定义技能ID
|
|||
|
|
/// </summary>
|
|||
|
|
public string botId { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备操作的具体对象,包括applianceId和additionalApplianceDetails。
|
|||
|
|
/// </summary>
|
|||
|
|
public Appliance appliance { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 表示打开设备的子功能,例如,打开关闭灶台的灯光、根据此字段识别此类的请求
|
|||
|
|
/// </summary>
|
|||
|
|
public string function { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 表示设备定时设置的值,它指定一个数字,代表时间戳,单位是秒。
|
|||
|
|
/// </summary>
|
|||
|
|
public Timestamp timestamp { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 灯光亮度的对象。
|
|||
|
|
/// </summary>
|
|||
|
|
public Brightness brightness { get; set; }
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// RGB灯
|
|||
|
|
/// </summary>
|
|||
|
|
public RGBValue lightingRgb { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 亮度增加的百分比对象。
|
|||
|
|
/// </summary>
|
|||
|
|
public DeltaPercentage deltaPercentage { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 灯设置的颜色。包括色相、饱和度、亮度(HSB)颜色模型。
|
|||
|
|
/// </summary>
|
|||
|
|
public Color color { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备温度调整信息
|
|||
|
|
/// </summary>
|
|||
|
|
public DeltaValue deltaValue { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备设定的目标温度。
|
|||
|
|
/// </summary>
|
|||
|
|
public TargetTemperature targetTemperature { get; set; }
|
|||
|
|
public TargetTemperature colorTemperature { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备设定的目标风风速。
|
|||
|
|
/// </summary>
|
|||
|
|
public FanSpeed fanSpeed { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备设定的目标风模式
|
|||
|
|
/// </summary>
|
|||
|
|
public Mode mode { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备移动方向信息。
|
|||
|
|
/// </summary>
|
|||
|
|
public Direction direction { get; set; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public class AppliancesRequest
|
|||
|
|
{
|
|||
|
|
public Header header { get; set; }
|
|||
|
|
public Payload payload { get; set; }
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public class DiscoverResponse
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备的属性信息。当设备没有属性信息时,协议中不需要传入该字段。每个设备允许同步的最大的属性数量是10。
|
|||
|
|
/// </summary>
|
|||
|
|
public class Attributes
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 属性名称,支持数字、字母和下划线,长度不能超过128个字符。
|
|||
|
|
/// </summary>
|
|||
|
|
public string name { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 属性值,支持多种json类型。
|
|||
|
|
/// </summary>
|
|||
|
|
public string value { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 属性值的单位名称,支持数字、字母和下划线,长度不能超过128个字符。
|
|||
|
|
/// </summary>
|
|||
|
|
public string scale { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 属性值取样的时间戳,单位是秒。
|
|||
|
|
/// </summary>
|
|||
|
|
public string timestampOfSample { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 属性值取样的时间误差,单位是ms。如果设备使用的是轮询时间间隔的取样方式,那么uncertaintyInMilliseconds就等于时间间隔。如温度传感器每1秒取样1次,那么uncertaintyInMilliseconds的值就是1000。
|
|||
|
|
/// </summary>
|
|||
|
|
public string uncertaintyInMilliseconds { get; set; }
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// discoveredGroups 对象的数组,该对象包含可发现分组,与用户设备帐户相关联的。 如果没有与用户帐户关联的分组,此属性应包含一个空数组。 如果发生错误,该属性可以为空数组[]。阵列中允许的最大项目数量为10。
|
|||
|
|
/// </summary>
|
|||
|
|
public class DiscoveredGroups
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 用户用来识别分组的名称, 不应包含特殊字符或标点符号,长度不超过20字符。
|
|||
|
|
/// </summary>
|
|||
|
|
public string groupName { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 分组所包含设备ID的数组,要求设备ID必须是已经发现的设备中的ID,否则会同步失败,每个分组设备ID数量不超过50。
|
|||
|
|
/// </summary>
|
|||
|
|
public List<string> applianceIds { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 分组备注信息,不能超过128个字符。
|
|||
|
|
/// </summary>
|
|||
|
|
public string groupNotes { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 提供给技能使用的分组相关的附加信息的键值对。该属性的内容不能超过2000字符。而且DuerOS也不了解或使用这些数据。
|
|||
|
|
/// </summary>
|
|||
|
|
public Dictionary<string, string> additionalGroupDetails { get; set; }
|
|||
|
|
}
|
|||
|
|
public class DiscoveredAppliances
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 支持的设备、场景类型。
|
|||
|
|
/// </summary>
|
|||
|
|
public List<string> applianceTypes { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备标识符。标识符在用户拥有的所有设备上必须是唯一的。此外,标识符需要在同一设备的多个发现请求之间保持一致。标识符可以包含任何字母或数字和以下特殊字符:_ - = # ; : ? @ &。标识符不能超过256个字符。
|
|||
|
|
/// </summary>
|
|||
|
|
public string applianceId { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备型号名称,是字符串类型,长度不能超过128个字符。
|
|||
|
|
/// </summary>
|
|||
|
|
public string modelName { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 供应商提供的设备版本。是字符串类型,长度不能超过128个字符。
|
|||
|
|
/// </summary>
|
|||
|
|
public string version { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 用户用来识别设备的名称。 是字符串类型,不能包含特殊字符和标点符号,长度不能超过128个字符。
|
|||
|
|
/// </summary>
|
|||
|
|
public string friendlyName { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备相关的描述,描述内容提需要提及设备厂商,使用场景及连接方式,长度不超过128个字符。
|
|||
|
|
/// </summary>
|
|||
|
|
public string friendlyDescription { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 别名
|
|||
|
|
/// </summary>
|
|||
|
|
public List<string> nicknames { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备当前是否能够到达。true表示设备当前可以到达,false表示当前设备不能到达。
|
|||
|
|
/// </summary>
|
|||
|
|
public bool reachable { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备支持的操作类型数组。
|
|||
|
|
/// </summary>
|
|||
|
|
public List<string> actions { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 提供给设备云使用,存放设备或场景相关的附加信息,是键值对。DuerOS不解析或使用这些数据。该属性的内容不能超过5000字节。
|
|||
|
|
/// </summary>
|
|||
|
|
public Dictionary<string, string> additionalApplianceDetails { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备厂商的名字。
|
|||
|
|
/// </summary>
|
|||
|
|
public string manufacturerName { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备的属性信息。当设备没有属性信息时,协议中不需要传入该字段。每个设备允许同步的最大的属性数量是10。
|
|||
|
|
/// </summary>
|
|||
|
|
//public List<Attributes> attributes { get; set; }
|
|||
|
|
}
|
|||
|
|
public class Payload
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 以对象数组返回客户关联设备云帐户的设备、场景。如客户关联帐户没有设备、场景则返回空数组。如果在发现过程中出现错误,字段值设置为null, 用户允许接入的最大的设备数量是300。
|
|||
|
|
/// </summary>
|
|||
|
|
public List<DiscoveredAppliances> discoveredAppliances { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 对象的数组,该对象包含可发现分组,与用户设备帐户相关联的。 如果没有与用户帐户关联的分组,此属性应包含一个空数组。 如果发生错误,该属性可以为空数组[]。阵列中允许的最大项目数量为10。
|
|||
|
|
/// </summary>
|
|||
|
|
public List<DiscoveredGroups> discoveredGroups { get; set; }
|
|||
|
|
}
|
|||
|
|
public class AppliancesResponse
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// Header
|
|||
|
|
/// </summary>
|
|||
|
|
public Header header { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备信息
|
|||
|
|
/// </summary>
|
|||
|
|
public Payload payload { get; set; }
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public class ControlRequest
|
|||
|
|
{
|
|||
|
|
public class Appliance
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备标识符。标识符在用户拥有的所有设备上必须是唯一的。此外,标识符需要在同一设备的多个发现请求之间保持一致。标识符可以包含任何字母或数字和以下特殊字符:_ - = # ; : ? @ &。标识符不能超过256个字符。
|
|||
|
|
/// </summary>
|
|||
|
|
public string applianceId { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 提供给设备云使用,存放设备或场景相关的附加信息,是键值对。DuerOS不解析或使用这些数据。该属性的内容不能超过5000字节。
|
|||
|
|
/// </summary>
|
|||
|
|
public Dictionary<string, string> additionalApplianceDetails { get; set; }
|
|||
|
|
}
|
|||
|
|
public class Payload
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备云端获取的access token。
|
|||
|
|
/// </summary>
|
|||
|
|
public string accessToken { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备操作的具体对象,包括applianceId和additionalApplianceDetails。
|
|||
|
|
/// </summary>
|
|||
|
|
public Appliance appliance { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 表示设备定时设置的值,它指定一个数字,代表时间戳,单位是秒。
|
|||
|
|
/// </summary>
|
|||
|
|
public string timestamp { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 灯光亮度的对象。
|
|||
|
|
/// </summary>
|
|||
|
|
public Brightness brightness { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 亮度增加的百分比对象。
|
|||
|
|
/// </summary>
|
|||
|
|
public DeltaPercentage deltaPercentage { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 灯设置的颜色。包括色相、饱和度、亮度(HSB)颜色模型。
|
|||
|
|
/// </summary>
|
|||
|
|
public Color color { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备温度调整信息
|
|||
|
|
/// </summary>
|
|||
|
|
public DeltaValue deltaValue { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备设定的目标温度。
|
|||
|
|
/// </summary>
|
|||
|
|
public TargetTemperature targetTemperature { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备的风速对象,包含一个属性值value或者一个属性值level,取决于用户自然表达。
|
|||
|
|
/// </summary>
|
|||
|
|
public FanSpeed fanSpeed { get; set; }
|
|||
|
|
}
|
|||
|
|
public class ControlAppRequest
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// Header
|
|||
|
|
/// </summary>
|
|||
|
|
public Header header { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// Payload
|
|||
|
|
/// </summary>
|
|||
|
|
public Payload payload { get; set; }
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public class ControlResponse
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备的属性信息。当设备没有属性信息时,协议中不需要传入该字段。每个设备允许同步的最大的属性数量是10。
|
|||
|
|
/// </summary>
|
|||
|
|
public class Attributes
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 属性名称,支持数字、字母和下划线,长度不能超过128个字符。
|
|||
|
|
/// </summary>
|
|||
|
|
public string name { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 属性值,支持多种json类型。
|
|||
|
|
/// </summary>
|
|||
|
|
public string value { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 属性值的单位名称,支持数字、字母和下划线,长度不能超过128个字符。
|
|||
|
|
/// </summary>
|
|||
|
|
public string scale { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 属性值取样的时间戳,单位是秒。
|
|||
|
|
/// </summary>
|
|||
|
|
public string timestampOfSample { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 属性值取样的时间误差,单位是ms。如果设备使用的是轮询时间间隔的取样方式,那么uncertaintyInMilliseconds就等于时间间隔。如温度传感器每1秒取样1次,那么uncertaintyInMilliseconds的值就是1000。
|
|||
|
|
/// </summary>
|
|||
|
|
public string uncertaintyInMilliseconds { get; set; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public class PreviousState
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 亮度设置前的对象。
|
|||
|
|
/// </summary>
|
|||
|
|
public Brightness brightness { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 温度设置成功后的设备模式。
|
|||
|
|
/// </summary>
|
|||
|
|
public Mode mode { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 温度设置成功后设备的温度,是double类型。
|
|||
|
|
/// </summary>
|
|||
|
|
public Temperature temperature { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备的风速对象,包含一个属性值value。
|
|||
|
|
/// </summary>
|
|||
|
|
public FanSpeed fanSpeed { get; set; }
|
|||
|
|
}
|
|||
|
|
public class Payload
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 亮度设置后的对象。
|
|||
|
|
/// </summary>
|
|||
|
|
public Brightness brightness { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 亮度设置前的对象。
|
|||
|
|
/// </summary>
|
|||
|
|
public PreviousState previousState { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设备属性信息,支持上报一个或多个属性信息。
|
|||
|
|
/// </summary>
|
|||
|
|
public List<Attributes> attributes { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 温度设置后的对象。
|
|||
|
|
/// </summary>
|
|||
|
|
public Temperature temperature { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 风速设置后的对象。
|
|||
|
|
/// </summary>
|
|||
|
|
public FanSpeed fanSpeed { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 模式设置后的对象。
|
|||
|
|
/// </summary>
|
|||
|
|
public Mode mode { get; set; }
|
|||
|
|
}
|
|||
|
|
public class ControlAppResponse
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// Header
|
|||
|
|
/// </summary>
|
|||
|
|
public Header header { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// Payload
|
|||
|
|
/// </summary>
|
|||
|
|
public Payload payload { get; set; }
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public class Error
|
|||
|
|
{
|
|||
|
|
public class Payload
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
public class ErrorResponse
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// Header
|
|||
|
|
/// </summary>
|
|||
|
|
public Header header { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// Payload
|
|||
|
|
/// </summary>
|
|||
|
|
public Payload payload { get; set; }
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|