| | |
| | | { |
| | | return null; |
| | | } |
| | | var gateWay = ZbGateway.GateWayList.Find(obj => (obj != null) && (obj.getGatewayBaseInfo != null) && (obj.getGatewayBaseInfo.gwID == CurrentGateWayId)); |
| | | var gateWay = ZbGateway.GateWayList.Find(obj => (obj != null) && (obj.GwId == CurrentGateWayId)); |
| | | if (gateWay == null) |
| | | { |
| | | gateWay = new ZbGateway { IsVirtual = true, }; |
| | | gateWay.getGatewayBaseInfo.gwID = CurrentGateWayId; |
| | | gateWay.getGatewayBaseInfo.HomeId = Shared.Common.Config.Instance.HomeId; |
| | | gateWay.GwId = CurrentGateWayId; |
| | | gateWay.HomeId = Shared.Common.Config.Instance.HomeId; |
| | | ZbGateway.GateWayList.Add(gateWay); |
| | | } |
| | | |
| | |
| | | { |
| | | return Newtonsoft.Json.JsonConvert.DeserializeObject<PMSensor>(strDeviceByte); |
| | | } |
| | | else if (strDeviceType == ZigBee.Device.DeviceType.ColorTemperatureLight.ToString()) |
| | | { |
| | | return Newtonsoft.Json.JsonConvert.DeserializeObject<ColorTemperatureLight>(strDeviceByte); |
| | | } |
| | | else { return null; } |
| | | //能少存一个变量就少存一个 |
| | | device.Type = (DeviceType)device.DeviceID; |
| | |
| | | { |
| | | //调光器 |
| | | IconPath = "Device/Light.png"; |
| | | if (Shared.Common.LocalDevice.Current.IsMiniLight(this) == true)
|
| | | {
|
| | | //mini夜灯
|
| | | IconPath = "Device/MiniNightLight.png";
|
| | | } |
| | | }
|
| | | else if (this.Type == DeviceType.ColorTemperatureLight)
|
| | | {
|
| | | //色温灯
|
| | | IconPath = "Device/ColorLightTemperature.png";
|
| | | } |
| | | else if (this.Type == DeviceType.OnOffOutput) |
| | | { |