| | |
| | | { |
| | | public static class CommonPage |
| | | { |
| | | |
| | | public static bool IsRemote; |
| | | public static Action RefreshAir; |
| | | public static string FindGatewayChilrenIPAddress = new NetWiFi().BroadcastIpAddress.ToString(); |
| | | private static string ip = "0.0.0.0"; |
| | |
| | | case Command.ReadLightAllLoopBrightnessACK: |
| | | for (int i = 0; i < receiveBytes[0]; i++) |
| | | { |
| | | var light = DB_ResidenceData.functionList.lights.Find((obj) => obj.bus_Data.SubnetID == subnetID && obj.bus_Data.DeviceID == deviceID && obj.bus_Data.LoopID == i); |
| | | var light = DB_ResidenceData.functionList.lights.Find((obj) => obj.bus_Data.SubnetID == subnetID && obj.bus_Data.DeviceID == deviceID && obj.bus_Data.LoopID == (i+1)); |
| | | if (light != null) |
| | | { |
| | | if (light.functionType != FunctionType.RGB) |
| | | { |
| | | light.trait_on_off.value = receiveBytes[2] == 0 ? "off" : "on"; |
| | | if (light.trait_on_off.value == "on") |
| | | light.trait_on_off.value = receiveBytes[light.bus_Data.LoopID] == 0 ? "off" : "on"; |
| | | if (light.trait_on_off.value.ToString() == "on") |
| | | { |
| | | light.brightness = receiveBytes[2]; |
| | | light.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[2] + "%"; |
| | |
| | | { |
| | | curtain.trait_on_off.value = "off"; |
| | | } |
| | | curtain.openLevel = receiveBytes[1]; |
| | | curtain.lastState = Language.StringByID(StringId.Open) + curtain.openLevel + "%"; |
| | | curtain.percent = receiveBytes[1]; |
| | | curtain.lastState = Language.StringByID(StringId.Open) + curtain.percent + "%"; |
| | | } |
| | | else |
| | | { |