|
|
|
@ -746,11 +746,6 @@ namespace FBeeService
|
|
|
|
|
}
|
|
|
|
|
else if (clusterId == ClusterId.alarm)
|
|
|
|
|
{
|
|
|
|
|
//0x0011有烟雾泄露且电压正常
|
|
|
|
|
//0x0010无烟雾泄露且电压正常
|
|
|
|
|
//0x0018无烟雾泄露且电压偏低
|
|
|
|
|
//0x0019有烟雾泄露电压偏低
|
|
|
|
|
|
|
|
|
|
device.Warning = BitConverter.ToInt16(props[0x0080]);
|
|
|
|
|
var bitArray = new BitArray(props[0x0080]);
|
|
|
|
|
device.IsWarning = bitArray[0];
|
|
|
|
@ -772,16 +767,29 @@ namespace FBeeService
|
|
|
|
|
}
|
|
|
|
|
else if (clusterId == ClusterId.voltage)
|
|
|
|
|
{
|
|
|
|
|
//device.Voltage = BitConverter.ToInt16(props[0x0020]);
|
|
|
|
|
//device.PM25 = BitConverter.ToInt16(props[0x0021]);
|
|
|
|
|
//device.PM10 = BitConverter.ToInt16(props[0x003e]);
|
|
|
|
|
device.Voltage = props[0x21][0] / 2f;
|
|
|
|
|
}
|
|
|
|
|
if (device.DeviceId == 0x0163)
|
|
|
|
|
{
|
|
|
|
|
if (props.ContainsKey(0x400a))
|
|
|
|
|
{
|
|
|
|
|
device.IRVersion = BitConverter.ToString((props[0x400a].Skip(3).Take(6).ToArray())).Replace("-", "").ToLower();
|
|
|
|
|
var irdata = props[0x400a];
|
|
|
|
|
if (irdata.Length == 10)
|
|
|
|
|
{
|
|
|
|
|
device.IRVersion = BitConverter.ToString((props[0x400a].Skip(3).Take(6).ToArray())).Replace("-", "").ToLower();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var irtype = BitConverter.ToInt16(irdata.Skip(9).Take(2).ToArray());
|
|
|
|
|
if (irtype == 0x0082)
|
|
|
|
|
{
|
|
|
|
|
var irDeviceType = irdata.Skip(11).First();
|
|
|
|
|
if (irDeviceType == 0x01)
|
|
|
|
|
{
|
|
|
|
|
var keyCode = BitConverter.ToInt16(irdata.Skip(12).Take(2).ToArray());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
deviceRepo.SaveChanges();
|
|
|
|
|