old mode 100755
new mode 100644
| | |
| | | { |
| | | case DeviceType.OnOffSwitch: |
| | | //控制面板 |
| | | ImagePath= "Device/DryContact.png"; |
| | | ImagePath = "Device/DryContact.png"; |
| | | break; |
| | | case DeviceType.OnOffOutput: |
| | | //继电器 |
| | | ImagePath= "Device/Relay.png"; |
| | | ImagePath = "Device/Relay.png"; |
| | | break; |
| | | case DeviceType.DimmableLight: |
| | | //调光灯 |
| | | ImagePath= "Device/DimmableLight.png"; |
| | | ImagePath = "Device/DimmableLight.png"; |
| | | break; |
| | | case DeviceType.WindowCoveringDevice: |
| | | //窗帘 |
| | | ImagePath= "Device/Curtain.png"; |
| | | ImagePath = "Device/Curtain.png"; |
| | | break; |
| | | case DeviceType.Thermostat: |
| | | //空调 |
| | | ImagePath= "Device/AirConditioner.png"; |
| | | ImagePath = "Device/AirConditioner.png"; |
| | | break; |
| | | case DeviceType.IASZone: |
| | | //传感器 |
| | | ImagePath= "Device/Sensor.png"; |
| | | ImagePath = "Device/Sensor.png"; |
| | | break; |
| | | case DeviceType.AirSwitch: |
| | | //空气开关 |
| | | ImagePath= "Device/AirSwitch.png"; |
| | | ImagePath = "Device/AirSwitch.png"; |
| | | break; |
| | | case DeviceType.Repeater: |
| | | //中继器 |
| | | ImagePath = "Device/AirSwitch.png"; |
| | | break; |
| | | case DeviceType.TemperatureSensor: |
| | | //温湿度传感器 |
| | | ImagePath = "Device/Sensor.png"; |
| | | break; |
| | | default: |
| | | ImagePath= "Device/Relay.png"; |
| | | ImagePath = "Device/Relay.png"; |
| | | break; |
| | | } |
| | | return ImagePath; |
| | |
| | | //中继器 |
| | | deviceTypeR = R.MyInternationalizationString.Repeater; |
| | | break; |
| | | case DeviceType.DoorLock: |
| | | //门锁 |
| | | deviceTypeR = R.MyInternationalizationString.DoorLock; |
| | | break; |
| | | |
| | | case DeviceType.TemperatureSensor: |
| | | //温度传感器 |
| | | deviceTypeR = R.MyInternationalizationString.TemperatureAndHumiditySensor; |
| | | break; |
| | | default: |
| | | deviceTypeR = R.MyInternationalizationString.UnknowDevice; |
| | | break; |
| | |
| | | { |
| | | return Language.StringByID(R.MyInternationalizationString.UnallocatedArea); |
| | | } |
| | | if(string.IsNullOrEmpty(room.FloorId)) |
| | | { |
| | | return room.Name; |
| | | } |
| | | var floorName = Config.Instance.Home.GetFloorNameById(room.FloorId); |
| | | if (floorName == null) |
| | | { |
| | |
| | | /// <returns></returns> |
| | | public string GetDeviceStatu() |
| | | { |
| | | if (CommonDevice.Type == DeviceType.OnOffOutput) |
| | | var device = CommonDevice; |
| | | if (device.Type == DeviceType.OnOffOutput) |
| | | { |
| | | if ((CommonDevice as ToggleLight).OnOffStatus == 1) |
| | | if ((device as ToggleLight).OnOffStatus == 1) |
| | | { |
| | | return Language.StringByID(R.MyInternationalizationString.Open); |
| | | } |
| | | return Language.StringByID(R.MyInternationalizationString.Shut); |
| | | } |
| | | else if (CommonDevice.Type == DeviceType.AirSwitch) |
| | | else if (device.Type == DeviceType.AirSwitch) |
| | | { |
| | | if ((CommonDevice as ZigBee.Device.AirSwitch).OnOffStatus == 1) |
| | | if ((device as ZigBee.Device.AirSwitch).OnOffStatus == 1) |
| | | { |
| | | return Language.StringByID(R.MyInternationalizationString.Open); |
| | | } |
| | | return Language.StringByID(R.MyInternationalizationString.Shut); |
| | | } |
| | | else if (CommonDevice.Type == DeviceType.DimmableLight) |
| | | else if (device.Type == DeviceType.DimmableLight) |
| | | { |
| | | if ((CommonDevice as DimmableLight).OnOffStatus == 0 || (CommonDevice as DimmableLight).Level == 0) |
| | | if ((device as DimmableLight).OnOffStatus == 0 || (device as DimmableLight).Level == 0) |
| | | { |
| | | return Language.StringByID(R.MyInternationalizationString.Shut); |
| | | } |
| | | return $"{(int)((CommonDevice as DimmableLight).Level * 1.0 / 254 * 100)}%"; |
| | | return $"{(int)((device as DimmableLight).Level * 1.0 / 254 * 100)}%"; |
| | | } |
| | | else if (CommonDevice.Type == DeviceType.WindowCoveringDevice) |
| | | else if (device.Type == DeviceType.WindowCoveringDevice) |
| | | { |
| | | if ((CommonDevice as ZigBee.Device.Rollershade).WcdCurrentPositionLiftPercentage == 0) |
| | | if ((device as Rollershade).WcdCurrentPositionLiftPercentage == 0) |
| | | { |
| | | return Language.StringByID(R.MyInternationalizationString.Shut); |
| | | } |
| | | return $"{(CommonDevice as ZigBee.Device.Rollershade).WcdCurrentPositionLiftPercentage}%"; |
| | | return $"{(device as Rollershade).WcdCurrentPositionLiftPercentage}%"; |
| | | } |
| | | //else if (CommonDevice.Type == DeviceType.Thermostat) |
| | | //{ |
| | | ////温度,模式,风速 |
| | | //string tempareture = string.Empty; |
| | | //string model = string.Empty; |
| | | //string wind = string.Empty; |
| | | //if (TaskList.Count == 0) |
| | | //{ |
| | | // return null; |
| | | //} |
| | | //foreach (var taskListInfo in TaskList) |
| | | //{ |
| | | // if (taskListInfo.Data1 == 3) |
| | | // { |
| | | // if (taskListInfo.Data2 == 0) |
| | | // { |
| | | // return Language.StringByID(R.MyInternationalizationString.Shut); |
| | | // } |
| | | // else if (taskListInfo.Data2 == 1) |
| | | // { |
| | | // model = Language.StringByID(R.MyInternationalizationString.Mode_Auto); |
| | | // } |
| | | // else if (taskListInfo.Data2 == 3) |
| | | // { |
| | | // model = Language.StringByID(R.MyInternationalizationString.Mode_Cool); |
| | | // } |
| | | // else if (taskListInfo.Data2 == 4) |
| | | // { |
| | | // model = Language.StringByID(R.MyInternationalizationString.Mode_Heat); |
| | | // } |
| | | // else if (taskListInfo.Data2 == 7) |
| | | // { |
| | | // model = Language.StringByID(R.MyInternationalizationString.Mode_FanOnly); |
| | | // } |
| | | // else if (taskListInfo.Data2 == 8) |
| | | // { |
| | | // model = Language.StringByID(R.MyInternationalizationString.Mode_Dry); |
| | | // } |
| | | // } |
| | | // else if (taskListInfo.Data1 == 4 || taskListInfo.Data1 == 5) |
| | | // { |
| | | // tempareture = $"{ taskListInfo.Data2} ℃"; |
| | | // } |
| | | // else if (taskListInfo.Data1 == 6) |
| | | // { |
| | | // if (taskListInfo.Data2 == 1) |
| | | // { |
| | | // wind = Language.StringByID(R.MyInternationalizationString.Fan_Low); |
| | | // } |
| | | // else if (taskListInfo.Data2 == 2) |
| | | // { |
| | | // wind = Language.StringByID(R.MyInternationalizationString.Fan_Middle); |
| | | // } |
| | | // else if (taskListInfo.Data2 == 3) |
| | | // { |
| | | // wind = Language.StringByID(R.MyInternationalizationString.Fan_Height); |
| | | // } |
| | | // } |
| | | //} |
| | | //return $"{tempareture},{model},{wind}"; |
| | | //} |
| | | else if (device.Type == DeviceType.Thermostat) |
| | | { |
| | | //温度,模式,风速 |
| | | string tempareture = string.Empty; |
| | | string model = string.Empty; |
| | | string wind = string.Empty; |
| | | |
| | | var ac = CommonDevice as AC; |
| | | |
| | | if (ac.currentSystemMode == 0) |
| | | { |
| | | return Language.StringByID(R.MyInternationalizationString.Shut); |
| | | } |
| | | else if (ac.currentSystemMode == 1) |
| | | { |
| | | model = Language.StringByID(R.MyInternationalizationString.Mode_Auto); |
| | | tempareture = $"{ac.currentCoolingSetpoint} ℃"; |
| | | } |
| | | else if (ac.currentSystemMode == 3) |
| | | { |
| | | model = Language.StringByID(R.MyInternationalizationString.Mode_Cool); |
| | | tempareture = $"{ac.currentCoolingSetpoint} ℃"; |
| | | } |
| | | else if (ac.currentSystemMode == 4) |
| | | { |
| | | model = Language.StringByID(R.MyInternationalizationString.Mode_Heat); |
| | | tempareture = $"{ac.currentHeatingSetpoint} ℃"; |
| | | } |
| | | else if (ac.currentSystemMode == 7) |
| | | { |
| | | model = Language.StringByID(R.MyInternationalizationString.Mode_FanOnly); |
| | | } |
| | | else if (ac.currentSystemMode == 8) |
| | | { |
| | | model = Language.StringByID(R.MyInternationalizationString.Mode_Dry); |
| | | tempareture = $"{ac.currentCoolingSetpoint} ℃"; |
| | | } |
| | | |
| | | if (ac.currentFanMode == 1) |
| | | { |
| | | wind = Language.StringByID(R.MyInternationalizationString.Fan_Low); |
| | | } |
| | | else if (ac.currentFanMode == 2) |
| | | { |
| | | wind = Language.StringByID(R.MyInternationalizationString.Fan_Middle); |
| | | } |
| | | else |
| | | { |
| | | wind = Language.StringByID(R.MyInternationalizationString.Fan_Height); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(tempareture)) |
| | | { |
| | | return $"{model},{wind}"; |
| | | } |
| | | return $"{model},{wind},{tempareture}"; |
| | | } |
| | | else if (device.Type == DeviceType.IASZone) |
| | | { |
| | | var ias = CommonDevice as IASZone; |
| | | //区分传感器具体类型 |
| | | var info = Common.LocalDevice.Current.GetNotHdlMyDeviceEnumInfo(new List<CommonDevice> { device },false); |
| | | if (info.ConcreteType == DeviceConcreteType.Sensor_Infrared) |
| | | { |
| | | //红外 |
| | | if (ias.iASInfo?.Alarm1 == 1) |
| | | { |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_HavePerson); |
| | | } |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_NoPerson); |
| | | } |
| | | else if (info.ConcreteType == DeviceConcreteType.Sensor_Water) |
| | | { |
| | | //水浸 |
| | | if (ias.iASInfo?.Alarm1 == 1) |
| | | { |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_HaveWater); |
| | | } |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Normal); |
| | | } |
| | | else if (info.ConcreteType == DeviceConcreteType.Sensor_DoorWindow) |
| | | { |
| | | //门窗 |
| | | if (ias.iASInfo?.Alarm1 == 1) |
| | | { |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Open); |
| | | } |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Close); |
| | | } |
| | | else if (info.ConcreteType == DeviceConcreteType.Sensor_CarbonMonoxide) |
| | | { |
| | | //燃气 |
| | | if (ias.iASInfo?.Alarm1 == 1) |
| | | { |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Alarm); |
| | | } |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Safe); |
| | | } |
| | | else if (info.ConcreteType == DeviceConcreteType.Sensor_Fire) |
| | | { |
| | | //烟雾 |
| | | if (ias.iASInfo?.Alarm1 == 1) |
| | | { |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Alarm); |
| | | } |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Safe); |
| | | } |
| | | else if (info.ConcreteType == DeviceConcreteType.Sensor_Pir) |
| | | { |
| | | //pir |
| | | if (ias.iASInfo?.Alarm1 == 1) |
| | | { |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Alarm); |
| | | } |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Safe); |
| | | } |
| | | else if (info.ConcreteType == DeviceConcreteType.Sensor_Keyfob) |
| | | { |
| | | //钥匙扣 |
| | | if (ias.iASInfo?.Alarm1 == 1) |
| | | { |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Alarm); |
| | | } |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Normal); |
| | | } |
| | | else if (info.ConcreteType == DeviceConcreteType.Sensor_Motion) |
| | | { |
| | | //运动传感器 |
| | | if (ias.iASInfo?.Alarm1 == 1) |
| | | { |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Alarm); |
| | | } |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Normal); |
| | | } |
| | | else if (info.ConcreteType == DeviceConcreteType.Sensor_EmergencyButton) |
| | | { |
| | | //紧急按钮 |
| | | if (ias.iASInfo?.Alarm1 == 1) |
| | | { |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Alarm); |
| | | } |
| | | return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Normal); |
| | | } |
| | | return null; |
| | | } |
| | | else if (device.Type == DeviceType.TemperatureSensor) |
| | | { |
| | | var tempera = CommonDevice as TemperatureSensor; |
| | | if(tempera.SensorDiv==1) |
| | | { |
| | | if (tempera.Temperatrue == 0) |
| | | { |
| | | return "--℃"; |
| | | } |
| | | return $"{tempera.Temperatrue}℃"; |
| | | } |
| | | else if(tempera.SensorDiv==2) |
| | | { |
| | | if (tempera.Humidity == 0) |
| | | { |
| | | return "--%"; |
| | | } |
| | | return $"{tempera.Humidity}%"; |
| | | } |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | return null; |