From 8da70e1a39328e1769b02bb1e05303916bb30eb5 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期一, 01 二月 2021 13:55:31 +0800
Subject: [PATCH] 水阀功能
---
HDL_ON/DAL/DriverLayer/Control.cs | 36 ++++++++++++++++++++++++++++++------
1 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index fe8179b..f134d15 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -86,6 +86,10 @@
{
if (IsRemote)//濡傛灉鏄繙绋�
{
+ if(DB_ResidenceData.Instance.HomeGateway == null)
+ {
+ return;
+ }
if (!DB_ResidenceData.Instance.HomeGateway.gatewayStatus)//杩滅▼鎯呭喌涓嬶紝缃戝叧鏈摼鎺ユ湇鍔″櫒涓嶈兘淇敼涓婚〉缃戝叧鐘舵��
{
new System.Threading.Thread(() => {
@@ -188,6 +192,11 @@
/// </summary>
public void SearchLoaclGateway()
{
+ //2021-01-15 : 浣忓畢娌℃湁缁戝畾缃戝叧鐨勬椂鍊欎笉鐢ㄦ悳绱紝骞朵笖涓嶈兘閾炬帴mqtt
+ if(DB_ResidenceData.Instance.HomeGateway == null)
+ {
+ return;
+ }
var ggg = DB_ResidenceData.Instance.GatewayType == 0 ? "涓�绔彛" : "A缃戝叧";
var ggg1 = MainPage.InternetStatus == 1 ? "4G" : "wifi";
MainPage.Log($"鎼滅储缃戝叧鍒楄〃锛岀綉鍏崇被鍨�:{ggg};缃戠粶绫诲瀷:{ggg1}");
@@ -270,8 +279,9 @@
/// </summary>
/// <param name="commandString"></param>
/// <param name="function"></param>
+ /// <param name="useRemote">鏄惁鐩存帴浣跨敤杩滅▼鍙戦��</param>
/// <returns></returns>
- public void SendWriteCommand(Function function, Dictionary<string, string> commandDictionary)
+ public void SendWriteCommand(Function function, Dictionary<string, string> commandDictionary, bool useRemote = false)
{
function.controlCounter++;
function.refreshTime = DateTime.Now;
@@ -301,7 +311,7 @@
MainPage.Log($"鍙戦�佹暟鎹�:{Newtonsoft.Json.JsonConvert.SerializeObject(commandDictionary)}");
//杩滅▼閫氳
- if (Ins.IsRemote)
+ if (Ins.IsRemote || useRemote == true)
{
DAL.Server.HttpServerRequest httpServer = new DAL.Server.HttpServerRequest();
//ALink鎺у埗銆丅us鎺у埗浣跨敤鍚屼竴涓帴鍙f帶鍒讹紝鐢变簯绔礋璐hВ鏋�
@@ -866,14 +876,28 @@
}
break;
case SPK.ElectricTV:
+ break;
+ case SPK.ElectricTuyaAirCleaner:
+ case SPK.ElectricTuyaFan:
+ case SPK.ElectricTuyaWeepRobot:
+ case SPK.ElectricTuyaWaterValve:
+ //璁惧鐘舵�佹帹閫�
+ var myDevice = Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp);
+ if (myDevice != null)
+ {
+ localObj = myDevice;
+ }
break;
default:
break;
}
- HomePage.UpdataFunctionStates(localObj);
- RoomPage.UpdataStates(localObj);
- FunctionPage.UpdataStates(localObj);
- ClassificationPage.UpdataInfo(localObj);
+ if (localObj != null)
+ {
+ HomePage.UpdataFunctionStates(localObj);
+ RoomPage.UpdataStates(localObj);
+ FunctionPage.UpdataStates(localObj);
+ ClassificationPage.UpdataInfo(localObj);
+ }
}
}
catch (Exception ex)
--
Gitblit v1.8.0