| | |
| | | using Shared.Phone.Device.CommonForm; |
| | | using Shared.Phone.UserCenter.DoorLock; |
| | | using System.Timers; |
| | | using Shared.Phone.Device.DeviceLogic; |
| | | |
| | | namespace Shared.Phone.UserView |
| | | { |
| | |
| | | BackgroundImagePath = room.BackgroundImage |
| | | }; |
| | | roomPageView.AddChidren(roomBackView); |
| | | var roomBG = new Button() |
| | | if (room.BackgroundImageType != 0) |
| | | { |
| | | UnSelectedImagePath = "Room/HomeBG.png", |
| | | //UnSelectedImagePath = room.BackgroundImage |
| | | }; |
| | | roomBackView.AddChidren(roomBG); |
| | | roomBackView.BackgroundImagePath = System.IO.Path.Combine(Config.Instance.FullPath, room.BackgroundImage); |
| | | } |
| | | |
| | | var roomName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(20), |
| | |
| | | //发送读取状态命令 |
| | | ReadStatus(rollerShade, () => |
| | | { |
| | | rollerShade.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(device.CommonDevice); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - rollerShade.LastDateTime).TotalSeconds) |
| | | { |
| | | rollerShade.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | ReadDeviceAttributeLogic.Instance.SendCurtainStatuComand(device.CommonDevice); |
| | | } |
| | | } |
| | | var lightView = new FunctionMainView(xx, yy); |
| | |
| | | //发送读取状态命令 |
| | | ReadStatus(light, () => |
| | | { |
| | | light.ReadOnOffStatus(); |
| | | light.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - light.LastDateTime).TotalSeconds) |
| | | { |
| | | light.ReadOnOffStatus(); |
| | | light.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice); |
| | | } |
| | | } |
| | | |
| | |
| | | //发送读取状态命令 |
| | | ReadStatus(airSwitch, () => |
| | | { |
| | | airSwitch.ReadOnOffStatus(); |
| | | airSwitch.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice); |
| | | }); |
| | | } |
| | | else |
| | |
| | | //防止短时间内多次读取设备状态 |
| | | if ((DateTime.Now - airSwitch.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan) |
| | | { |
| | | airSwitch.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | airSwitch.ReadOnOffStatus(); |
| | | ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice); |
| | | } |
| | | } |
| | | |
| | |
| | | //发送读取状态命令 |
| | | ReadStatus(ac, () => |
| | | { |
| | | ac.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | ac.ReadLocalTemperature(); |
| | | ac.ReadCoolingSetpoint(); |
| | | ac.ReadHeatingSetpoint(); |
| | | ac.ReadAutoSetpoint(); |
| | | ac.ReadFanMode(); |
| | | ac.ReadSystemMode(); |
| | | ac.ReadSystemFansSwingMode(); |
| | | ac.ReadModeSupport(); |
| | | ReadDeviceAttributeLogic.Instance.SendACStatuComand(device.CommonDevice); |
| | | }); |
| | | } |
| | | else |
| | |
| | | //防止短时间内多次读取设备状态 |
| | | if ((DateTime.Now - ac.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan) |
| | | { |
| | | ac.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | ac.ReadLocalTemperature(); |
| | | ac.ReadCoolingSetpoint(); |
| | | ac.ReadHeatingSetpoint(); |
| | | ac.ReadAutoSetpoint(); |
| | | ac.ReadFanMode(); |
| | | ac.ReadSystemMode(); |
| | | ac.ReadSystemFansSwingMode(); |
| | | ac.ReadModeSupport(); |
| | | ReadDeviceAttributeLogic.Instance.SendACStatuComand(device.CommonDevice); |
| | | } |
| | | } |
| | | var lightView = new FunctionMainView(xx, yy); |
| | |
| | | //发送读取状态命令 |
| | | ReadStatus(dimmableLight, () => |
| | | { |
| | | dimmableLight.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | dimmableLight.ReadOnOffStatus(); |
| | | ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(device.CommonDevice); |
| | | }); |
| | | } |
| | | else |
| | |
| | | //防止短时间内多次读取设备状态 |
| | | if ((DateTime.Now - dimmableLight.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan) |
| | | { |
| | | dimmableLight.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | dimmableLight.ReadOnOffStatus(); |
| | | ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(device.CommonDevice); |
| | | } |
| | | } |
| | | |
| | |
| | | if (dimmableLight.Gateway == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (dimmableLight.Gateway.IsVirtual) |
| | | { |
| | | ReadStatus(dimmableLight, () => |
| | | { |
| | | dimmableLight.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | if ((DateTime.Now - dimmableLight.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan) |
| | | { |
| | | dimmableLight.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | } |
| | | } |
| | | |
| | | var lightView = new FunctionMainView(xx, yy); |