| | |
| | | }
|
| | | //已经接收到状态
|
| | | locadevice.HadReadDeviceStatu = true;
|
| | |
|
| | | if (locadevice is LightBase)
|
| | | {
|
| | | //当接收到亮度值时,默认打开
|
| | | ((LightBase)locadevice).OnOffStatus = 1;
|
| | | }
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
| | | //温度传感器
|
| | | if (locadevice is TemperatureSensor)
|
| | | {
|
| | | ((TemperatureSensor)locadevice).Temperatrue = temperatrue;
|
| | | ((TemperatureSensor)locadevice).currentTemperature = temperatrue;
|
| | | }
|
| | | //PM2.5传感器
|
| | | else if (locadevice is PMSensor)
|
| | |
| | | }
|
| | | //已经接收到状态
|
| | | locadevice.HadReadDeviceStatu = true;
|
| | | //温度值需要保存
|
| | | locadevice.ReSave();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | //湿度传感器
|
| | | if (locadevice is TemperatureSensor)
|
| | | {
|
| | | ((TemperatureSensor)locadevice).Humidity = humidity;
|
| | | ((TemperatureSensor)locadevice).currentHumidity = humidity;
|
| | | }
|
| | | //新风的湿度传感器
|
| | | else if (locadevice is HumiditySensor)
|
| | | {
|
| | | ((HumiditySensor)locadevice).Humidity = humidity;
|
| | | ((HumiditySensor)locadevice).currentHumidity = humidity;
|
| | | }
|
| | | //PM2.5传感器
|
| | | else if (locadevice is PMSensor)
|
| | | {
|
| | | ((PMSensor)locadevice).currentHumidity = (int)humidity;
|
| | | }
|
| | | //已经接收到状态
|
| | | locadevice.HadReadDeviceStatu = true;
|
| | | //湿度值需要保存
|
| | | locadevice.ReSave();
|
| | | }
|
| | | //已经接收到状态
|
| | | locadevice.HadReadDeviceStatu = true;
|
| | | }
|
| | | }
|
| | | #endregion
|