语音控制 调光的时候,只有开的灯才会调。

This commit is contained in:
2025-12-24 19:41:55 +08:00
parent 53cb2e9239
commit b575adb844
8 changed files with 68 additions and 12 deletions

View File

@@ -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;

View File

@@ -240,7 +240,16 @@ namespace WebSite.Controllers
try
{
var sysHotel = SysHotelManager.Get(CurrentHotelID);
string vvv = sysHotel.WelcomeBGM;
sysHotel.WelcomeBGM = "";
string file = string.Format(Tools.GetApplicationPath() + @"welcomebgm\{0}", vvv);
string path = Path.GetDirectoryName(file);
if (Directory.Exists(path))
{
System.IO.File.Delete(path);
}
SysHotelManager.Update(sysHotel);
return Json(new { IsSuccess = true }, JsonRequestBehavior.AllowGet);
}
@@ -300,12 +309,14 @@ namespace WebSite.Controllers
//sysHotel.TCLAppSecret = entity.TCLAppSecret;
SysHotelManager.Update(sysHotel);
if (!string.IsNullOrEmpty(entity.WelcomeBGM))
{
string ffg = "https://www.boonlive-rcu.com/welcomebgm/" + entity.WelcomeBGM;
TianMaoOperation.PostWebRequestToTianMao("AddOrUpdateWelcomeText",
Newtonsoft.Json.JsonConvert.SerializeObject(new { HotelId = CurrentHotelID, MusicUrl = ffg, WelcomeText = entity.WelcomeSpeech }), CurrentHotelCode, "");//通知天猫精灵播放欢迎词
}
//if (!string.IsNullOrEmpty(entity.WelcomeBGM))
//{
// //string hotelid111=entity. .Split('&')[0],
// //string RoomNo = cuid.Split('&')[1];
// string ffg = "https://www.boonlive-rcu.com/welcomebgm/" + entity.WelcomeBGM;
// TianMaoOperation.PostWebRequestToTianMao("AddOrUpdateWelcomeText",
// Newtonsoft.Json.JsonConvert.SerializeObject(new { HotelId = CurrentHotelID, MusicUrl = ffg, WelcomeText = entity.WelcomeSpeech }), CurrentHotelCode, "");//通知天猫精灵播放欢迎词
//}
if (sysHotel.IsUseQianLiMa)
{
QianLiMa_PMS.QiYong(sysHotel.Code, "add");