语音控制 调光的时候,只有开的灯才会调。
This commit is contained in:
@@ -666,6 +666,8 @@ namespace WebSite.Controllers
|
||||
device.AddressType = RCUHost.Protocols.AddressType.DeviceAddress;
|
||||
device.Type = hostModal.Modal.Type;
|
||||
|
||||
string KKey = CacheKey.HostModalStatus_Prefix + "_" + host.ID.ToString() + "_" + device.Address;
|
||||
var hostModal_T = CSRedisCacheHelper.Get_Partition<HostModal_Cache>(KKey);
|
||||
switch (request.header.name)
|
||||
{
|
||||
case "TurnOnRequest"://打开
|
||||
@@ -683,6 +685,11 @@ namespace WebSite.Controllers
|
||||
payload.previousState = previousState;
|
||||
break;
|
||||
case "SetBrightnessPercentageRequest"://设置亮度
|
||||
if (hotel_code == 1085 || hotel_code == 1001 || hotel_code == 1003 || hotel_code > 2000)
|
||||
{
|
||||
//logger.Error("查询的Key值:"+KKey);
|
||||
if (hostModal_T != null && hostModal_T.Status == 2) { continue; }
|
||||
}
|
||||
confirmationName = "SetBrightnessPercentageConfirmation";
|
||||
status = 1;
|
||||
brightness = Convert.ToInt16(request.payload.brightness.value);
|
||||
@@ -690,6 +697,10 @@ namespace WebSite.Controllers
|
||||
payload.previousState = previousState;
|
||||
break;
|
||||
case "IncrementBrightnessPercentageRequest"://调亮
|
||||
if (hotel_code == 1085 || hotel_code == 1001 || hotel_code == 1003 || hotel_code > 2000)
|
||||
{
|
||||
if (hostModal_T != null && hostModal_T.Status == 2) { continue; }
|
||||
}
|
||||
confirmationName = "IncrementBrightnessPercentageConfirmation";
|
||||
status = 1;
|
||||
brightness += Convert.ToInt16(request.payload.deltaPercentage.value);
|
||||
@@ -701,7 +712,10 @@ namespace WebSite.Controllers
|
||||
payload.previousState = previousState;
|
||||
break;
|
||||
case "DecrementBrightnessPercentageRequest"://调暗
|
||||
if (hostModal.Status == 2) { continue; }
|
||||
if (hotel_code == 1085 || hotel_code == 1001 || hotel_code == 1003 || hotel_code > 2000)
|
||||
{
|
||||
if (hostModal_T != null && hostModal_T.Status == 2) { continue; }
|
||||
}
|
||||
confirmationName = "DecrementBrightnessPercentageConfirmation";
|
||||
status = 1;
|
||||
brightness -= Convert.ToInt16(request.payload.deltaPercentage.value);
|
||||
@@ -4329,6 +4343,14 @@ namespace WebSite.Controllers
|
||||
}
|
||||
break;
|
||||
case "DimmingLight"://调光
|
||||
string KKey = CacheKey.HostModalStatus_Prefix + "_" + host.ID.ToString() + "_" + device.Address;
|
||||
var hostModal_T = CSRedisCacheHelper.Get_Partition<HostModal_Cache>(KKey);
|
||||
|
||||
if (co == 1085 || co == 1001 || co == 1003 || co > 2000)
|
||||
{
|
||||
//logger.Error("查询的Key值:"+KKey);
|
||||
if (hostModal_T != null && hostModal_T.Status == 2) { continue; }
|
||||
}
|
||||
if (devicesItem.value.HasValue)
|
||||
{
|
||||
switch (devicesItem.value)
|
||||
@@ -4345,6 +4367,7 @@ namespace WebSite.Controllers
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (devicesItem.value_up.HasValue)
|
||||
{
|
||||
status = 1;
|
||||
|
||||
Reference in New Issue
Block a user