gxc
2019-11-15 05ce435c3b58e53eeab04c672affdeeab75f3036
ZigbeeApp/Shared/Common/DeviceUI.cs
@@ -35,9 +35,9 @@
                var myDevice = Common.LocalDevice.Current.GetDevice(DeviceAddr, DeviceEpoint);
                if (myDevice != null)
                {
                    return $"DeviceUI_{myDevice.FilePath}";
                    return myDevice.FilePath;
                }
                return $"DeviceUI_Unkwon";
                return $"Device_Unkwon";
            }
        }
@@ -304,6 +304,11 @@
                    //中继器
                    deviceTypeR = R.MyInternationalizationString.Repeater;
                    break;
                case DeviceType.DoorLock:
                    //门锁
                    deviceTypeR = R.MyInternationalizationString.DoorLock;
                    break;
                default:
                    deviceTypeR = R.MyInternationalizationString.UnknowDevice;
                    break;
@@ -342,39 +347,40 @@
        /// <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 Rollershade).WcdCurrentPositionLiftPercentage == 0)
                if ((device as Rollershade).WcdCurrentPositionLiftPercentage == 0)
                {
                    return Language.StringByID(R.MyInternationalizationString.Shut);
                }
                return $"{(CommonDevice as Rollershade).WcdCurrentPositionLiftPercentage}%";
                return $"{(device as Rollershade).WcdCurrentPositionLiftPercentage}%";
            }
            else if (CommonDevice.Type == DeviceType.Thermostat)
            else if (device.Type == DeviceType.Thermostat)
            {
                //温度,模式,风速
                string tempareture = string.Empty;
@@ -429,10 +435,7 @@
                {
                    return $"{model},{wind}";
                }
                else
                {
                    return $"{model},{wind},{tempareture}";
                }
                return $"{model},{wind},{tempareture}";
            }
            else
            {