| | |
| | | } |
| | | else if (strDeviceType == ZigBee.Device.DeviceType.PMSensor.ToString()) |
| | | { |
| | | return Newtonsoft.Json.JsonConvert.DeserializeObject<PMSensor>(strDeviceByte); |
| | | device = Newtonsoft.Json.JsonConvert.DeserializeObject<PMSensor>(strDeviceByte); |
| | | } |
| | | else if (strDeviceType == ZigBee.Device.DeviceType.ColorTemperatureLight.ToString()) |
| | | { |
| | | return Newtonsoft.Json.JsonConvert.DeserializeObject<ColorTemperatureLight>(strDeviceByte); |
| | | device = Newtonsoft.Json.JsonConvert.DeserializeObject<ColorTemperatureLight>(strDeviceByte); |
| | | }
|
| | | else if (strDeviceType == ZigBee.Device.DeviceType.Buzzer.ToString()) |
| | | { |
| | | return Newtonsoft.Json.JsonConvert.DeserializeObject<Buzzer>(strDeviceByte); |
| | | device = Newtonsoft.Json.JsonConvert.DeserializeObject<Buzzer>(strDeviceByte); |
| | | } |
| | | else { return null; } |
| | | else if (strDeviceType == ZigBee.Device.DeviceType.ColorDimmableLight.ToString()) |
| | | { |
| | | device = Newtonsoft.Json.JsonConvert.DeserializeObject<ColorDimmableLight>(strDeviceByte); |
| | | } |
| | | else if (strDeviceType == ZigBee.Device.DeviceType.DimmerSwitch.ToString()) |
| | | { |
| | | device = Newtonsoft.Json.JsonConvert.DeserializeObject<DimmerSwitch>(strDeviceByte); |
| | | } |
| | | else |
| | | { |
| | | return null; |
| | | } |
| | | //能少存一个变量就少存一个 |
| | | device.Type = (DeviceType)device.DeviceID; |
| | | |