-
Notifications
You must be signed in to change notification settings - Fork 43
/
dehumidifier.go
46 lines (36 loc) · 1.68 KB
/
dehumidifier.go
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package service
import (
"github.com/brutella/hap/characteristic"
)
type Dehumidifier struct {
*S
CurrentRelativeHumidity *characteristic.CurrentRelativeHumidity
CurrentHumidifierDehumidifierState *characteristic.CurrentHumidifierDehumidifierState
TargetHumidifierDehumidifierState *characteristic.TargetHumidifierDehumidifierState
Active *characteristic.Active
RelativeHumidityDehumidifierThreshold *characteristic.RelativeHumidityDehumidifierThreshold
}
func NewDehumidifier() *Dehumidifier {
s := Dehumidifier{}
s.S = New(TypeHumidifierDehumidifier)
s.CurrentRelativeHumidity = characteristic.NewCurrentRelativeHumidity()
s.AddC(s.CurrentRelativeHumidity.C)
s.CurrentHumidifierDehumidifierState = characteristic.NewCurrentHumidifierDehumidifierState()
s.CurrentHumidifierDehumidifierState.ValidVals = []int{
characteristic.CurrentHumidifierDehumidifierStateInactive,
characteristic.CurrentHumidifierDehumidifierStateIdle,
characteristic.CurrentHumidifierDehumidifierStateDehumidifying,
}
s.AddC(s.CurrentHumidifierDehumidifierState.C)
s.TargetHumidifierDehumidifierState = characteristic.NewTargetHumidifierDehumidifierState()
s.TargetHumidifierDehumidifierState.ValidVals = []int{
characteristic.TargetHumidifierDehumidifierStateDehumidifier,
}
s.TargetHumidifierDehumidifierState.SetValue(characteristic.TargetHumidifierDehumidifierStateDehumidifier)
s.AddC(s.TargetHumidifierDehumidifierState.C)
s.Active = characteristic.NewActive()
s.AddC(s.Active.C)
s.RelativeHumidityDehumidifierThreshold = characteristic.NewRelativeHumidityDehumidifierThreshold()
s.AddC(s.RelativeHumidityDehumidifierThreshold.C)
return &s
}