From 0bdc0a135dbe31761b53f432ed34f347f0a4e36b Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 05 三月 2020 10:49:41 +0800
Subject: [PATCH] 20200304
---
HDL_ON/DAL/Net/CommonPage.cs | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/HDL_ON/DAL/Net/CommonPage.cs b/HDL_ON/DAL/Net/CommonPage.cs
index efd3d4a..582cbf2 100644
--- a/HDL_ON/DAL/Net/CommonPage.cs
+++ b/HDL_ON/DAL/Net/CommonPage.cs
@@ -97,12 +97,13 @@
{
switch (command)
{
+ case Command.ReadLightSingleLoopBrightnessACK:
case Command.SetSingleLightACK:
- foreach (var function in DB_ResidenceData.residenceData.functions)
+ foreach (var function in DB_ResidenceData.residenceData.functions.lights)
{
if (function.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
{
- if (function.funcType == FunctionType.Light)
+ if (function.functionCategory == FunctionType.Light)
{
var light = function as Light;
if (receiveBytes[2] == 0 && light.state == 0)
@@ -113,17 +114,19 @@
{
break;
}
- if (function.bus_DeviceType == "Relay")
+ if (function.functionType == "Relay")
{
var relay = function as Light;
relay.state = receiveBytes[2] == 0 ? 0 : 1;
HomePage.UpdataLightView(relay);
+ //RoomPage.
}
- else if (function.bus_DeviceType == "Dimmer")
+ else if (function.functionType == "brightness")
{
- var dimmer = function as Dimmer;
+ var dimmer = function as Light;
dimmer.state = receiveBytes[2] == 0 ? 0 : 1;
- dimmer.brightness = receiveBytes[1];
+ dimmer.dicPropert["brightness"] = receiveBytes[1];
+ //dimmer.brightness = receiveBytes[1];
if (receiveBytes[2] > 0)
dimmer.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[2] + "%";
HomePage.UpdataLightView(dimmer);
--
Gitblit v1.8.0