using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Domain.Rokid.Request
{
public class Authorization
{
///
/// BearerToken
///
public string type { get; set; }
///
/// a-token-from-skill
///
public string token { get; set; }
}
public class Header
{
///
/// 5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4
///
public string messageId { get; set; }
///
/// Rokid.Control
///
public string @namespace { get; set; }
///
/// Brightness.Adjust
///
public string name { get; set; }
///
/// v1
///
public string payloadVersion { get; set; }
///
/// Authorization
///
public Authorization authorization { get; set; }
}
public class AdditionalInfo
{
///
/// value
///
public string key { get; set; }
}
public class States
{
///
/// Color
///
public string @interface { get; set; }
///
/// Value
///
public string value { get; set; }
}
public class Endpoint
{
///
/// 开发者自己定义的终端Id
///
public string endpointId { get; set; }
///
/// AdditionalInfo
///
public AdditionalInfo additionalInfo { get; set; }
///
/// States
///
public List states { get; set; }
}
public class Payload
{
///
/// 相对值
///
public int? delta { get; set; }
///
/// 百分比
///
public int? value { get; set; }
}
public class RootRequest
{
///
/// Header
///
public Header header { get; set; }
///
/// Endpoint
///
public Endpoint endpoint { get; set; }
///
/// Payload
///
public Payload payload { get; set; }
}
}
namespace Domain.Rokid.Discovery
{
public class Header
{
///
/// 5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4
///
public string messageId { get; set; }
///
/// Rokid
///
public string @namespace { get; set; }
///
/// DiscoveryResponse
///
public string name { get; set; }
///
/// v1
///
public string payloadVersion { get; set; }
}
public class AdditionalInfo
{
///
/// value
///
public string key { get; set; }
}
public class Capabilities
{
///
/// Switch
///
public string @interface { get; set; }
///
/// SupportedOperations
///
public List supportedOperations { get; set; }
///
/// ProactivelyReported
///
public bool proactivelyReported { get; set; }
///
/// Retrievable
///
public bool retrievable { get; set; }
}
///
/// 自定义技能
///
public static class CustomerCapabilities
{
///
/// 开关技能
///
///
public static List SwitchCapabilities()
{
List capabilities = new List();
capabilities.Add(new Capabilities
{
@interface = "Switch",
supportedOperations = new List { "On", "Off" },
proactivelyReported = true,
retrievable = true
});
return capabilities;
}
///
/// 窗帘技能
///
///
public static List MotionSwitchCapabilities()
{
List capabilities = new List();
capabilities.Add(new Capabilities
{
@interface = "Switch",
supportedOperations = new List { "On", "Off" },
proactivelyReported = true,
retrievable = true
});
capabilities.Add(new Capabilities
{
@interface = "MotionSwitch",
supportedOperations = new List { "On", "Off" },
proactivelyReported = true,
retrievable = true
});
return capabilities;
}
///
/// 调光技能
///
///
public static List BrightnessCapabilities()
{
List capabilities = new List();
capabilities.Add(new Capabilities
{
@interface = "Switch",
supportedOperations = new List { "On", "Off" },
proactivelyReported = true,
retrievable = true
});
capabilities.Add(new Capabilities
{
@interface = "Brightness",
supportedOperations = new List { "Set", "SetMax", "SetMin", "Adjust" },
proactivelyReported = true,
retrievable = true
});
return capabilities;
}
///
/// 空调技能
///
///
public static List AirCapabilities()
{
List capabilities = new List();
capabilities.Add(new Capabilities
{
@interface = "Switch",//开关
supportedOperations = new List { "On", "Off" },
proactivelyReported = true,
retrievable = true
});
capabilities.Add(new Capabilities
{
@interface = "Temperature",//温度
supportedOperations = new List { "Set", "SetMax", "SetMin", "Adjust" },
proactivelyReported = true,
retrievable = true
});
capabilities.Add(new Capabilities
{
@interface = "FanSpeed",//风速
supportedOperations = new List { "Set", "SetMax", "SetMin", "Adjust" },//自动0,高3,低1,中2
proactivelyReported = true,
retrievable = true
});
capabilities.Add(new Capabilities
{
@interface = "Mode",//模式
supportedOperations = new List { "Auto", "Cool", "Heat", "Fan" },//"Manual","Dry", "Silent", "Energy", "Sleep"
proactivelyReported = true,
retrievable = true
});
return capabilities;
}
}
public class States
{
///
/// Switch
///
public string @interface { get; set; }
///
/// On
///
public string value { get; set; }
///
/// 2018-03-15T18:00:00.000Z
///
public string timeOfSample { get; set; }
}
public class Endpoints
{
///
/// blwrcu_8101_light001
///
public string endpointId { get; set; }
///
/// light
///
public string displayType { get; set; }
///
/// 床头灯
///
public string displayName { get; set; }
///
/// 房号
///
public string recommendRoomName { get; set; }
///
/// 家名
///
public string recommendHomeName { get; set; }
///
/// GROSS-REIS-LAMPE-ALPHA
///
public string modelId { get; set; }
///
/// AdditionalInfo
///
public AdditionalInfo additionalInfo { get; set; }
///
/// Capabilities
///
public List capabilities { get; set; }
///
/// States
///
public List states { get; set; }
}
public class Payload
{
///
/// Endpoints
///
public List endpoints { get; set; }
}
public class DiscoveryResponse
{
///
/// Header
///
public Header header { get; set; }
///
/// Payload
///
public Payload payload { get; set; }
}
}
namespace Domain.Rokid.Control
{
public class Header
{
///
/// 5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4
///
public string messageId { get; set; }
///
/// Rokid
///
public string @namespace { get; set; }
///
/// Response
///
public string name { get; set; }
///
/// v1
///
public string payloadVersion { get; set; }
}
public class States
{
///
/// Color
///
public string @interface { get; set; }
///
/// Value
///
public string value { get; set; }
}
public class Endpoint
{
///
/// 开发者自己定义的终端Id
///
public string endpointId { get; set; }
///
/// States
///
public List states { get; set; }
}
public class Payload
{
}
public class ControlResponse
{
///
/// Header
///
public Header header { get; set; }
///
/// Endpoint
///
public Endpoint endpoint { get; set; }
///
/// Payload
///
public Payload payload { get; set; }
}
}
namespace Domain.Rokid.Error
{
public class Header
{
///
/// 789-123
///
public string messageId { get; set; }
///
/// Rokid
///
public string @namespace { get; set; }
///
/// ErrorResponse
///
public string name { get; set; }
///
/// v1
///
public string payloadVersion { get; set; }
}
public class Payload
{
///
/// E_DRIVER_ERROR
///
public string name { get; set; }
///
/// 发生了一些不可告人的错误
///
public string message { get; set; }
}
public class ErrorResponse
{
///
/// Header
///
public Header header { get; set; }
///
/// Payload
///
public Payload payload { get; set; }
}
}