HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-10-10 2ed75b8b337048e5d75e6d9ec8307633134f02fd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using System.Collections.Generic;
 
namespace ZigBee.Device
{
    public class TemperatureSensor: CommonDevice
    {
        /// <summary>
        /// 因为这两个东西共用同一个设备ID,所以 1:温度传感器  2:湿度传感器
        /// </summary>
        public int SensorDiv = 1;
 
        public TemperatureSensor()
        {
            this.Type = DeviceType.TemperatureSensor ;
        }
 
        /// <summary>
        /// 读取温/湿度
        /// </summary>
        public void ReadTemperature()
        {
            ReadAttri(Device.Cluster_ID.TemperatureMeasurement, AttriButeId.MeasuredValue );
            ReadAttri(Device.Cluster_ID.RelativeHumidityMeasurement, AttriButeId.MeasuredValue);
        }
    }
}