| | |
| | | using System.Text; |
| | | using System.Collections.Generic; |
| | | using Shared.SimpleControl.Phone; |
| | | using service.hdlcontrol.com_WebServiceAirQuality; |
| | | //using service.hdlcontrol.com_WebServiceAirQuality; |
| | | |
| | | namespace Shared.SimpleControl |
| | | { |
| | | public class AirQuality |
| | | { |
| | | public string city; |
| | | public string airQTemp; |
| | | public string airQHumidity; |
| | | public string airQAirPM25; |
| | | public string airQAirWeather; |
| | | } |
| | | |
| | | public static class CommonPage |
| | | { |
| | | public static AirQuality AirQuality; |
| | |
| | | //127.0.0.1 |
| | | if (ip == "0.0.0.0") { |
| | | try { |
| | | ip = System.Net.Dns.GetHostEntry ("homeautomation.havells.com").AddressList [0].ToString (); |
| | | ip = System.Net.Dns.GetHostEntry ("smarth-api.havells.com").AddressList [0].ToString (); |
| | | } catch { } |
| | | } |
| | | return new System.Net.IPEndPoint (System.Net.IPAddress.Parse (ip), 9999); |
| | |
| | | common.isMixBox = true; |
| | | } else { |
| | | Application.RunOnMainThread (() => { |
| | | MainPage.Loading.Start ("Search for device:" + devcieTempName); |
| | | //MainPage.Loading.Start ("Search for device:" + devcieTempName); |
| | | ++searchTotal; |
| | | GuideSettingGateway.InitSearchDeviceList (common); |
| | | for (int k = 1; k <= common.LoopCount; k++) { |
| | |
| | | //} else if (deviceType1.ToString ().Contains ("Switch")) { |
| | | // devcieLoopName = "Relay SW" + usefullBytes [2].ToString (); |
| | | //} |
| | | |
| | | //2020-07-03 如果是红外模块类型,备注为空的话,默认为TV名字 |
| | | if (deviceType1 == DeviceType.InfraredMode) { |
| | | devcieLoopName = "TV " + usefullBytes [2].ToString (); |
| | | } else if (deviceType1 == DeviceType.ACInfrared) { |
| | | //2020-08-28 如果是红外空调类型,备注为空的话,默认为AC名字 |
| | | devcieLoopName = "AC " + usefullBytes [2].ToString (); |
| | | } |
| | | byte [] ddd = CommonPage.MyEncodingGB2312.GetBytes (devcieLoopName); |
| | | byte [] newddd = new byte [20]; |
| | | Array.Copy (ddd, 0, newddd, 0, 20 < ddd.Length ? 20 : ddd.Length); |