forked from brutella/hc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
thermostat.go
61 lines (44 loc) · 2.27 KB
/
thermostat.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// THIS FILE IS AUTO-GENERATED
package service
import (
"github.com/grumpylabs/hcf/characteristic"
)
const TypeThermostat = "4A"
type Thermostat struct {
*Service
CurrentHeatingCoolingState *characteristic.CurrentHeatingCoolingState
TargetHeatingCoolingState *characteristic.TargetHeatingCoolingState
CurrentTemperature *characteristic.CurrentTemperature
TargetTemperature *characteristic.TargetTemperature
TemperatureDisplayUnits *characteristic.TemperatureDisplayUnits
CurrentRelativeHumidity *characteristic.CurrentRelativeHumidity
TargetRelativeHumidity *characteristic.TargetRelativeHumidity
CoolingThresholdTemperature *characteristic.CoolingThresholdTemperature
HeatingThresholdTemperature *characteristic.HeatingThresholdTemperature
Name *characteristic.Name
}
func NewThermostat() *Thermostat {
svc := Thermostat{}
svc.Service = New(TypeThermostat)
svc.CurrentHeatingCoolingState = characteristic.NewCurrentHeatingCoolingState()
svc.AddCharacteristic(svc.CurrentHeatingCoolingState.Characteristic)
svc.TargetHeatingCoolingState = characteristic.NewTargetHeatingCoolingState()
svc.AddCharacteristic(svc.TargetHeatingCoolingState.Characteristic)
svc.CurrentTemperature = characteristic.NewCurrentTemperature()
svc.AddCharacteristic(svc.CurrentTemperature.Characteristic)
svc.TargetTemperature = characteristic.NewTargetTemperature()
svc.AddCharacteristic(svc.TargetTemperature.Characteristic)
svc.TemperatureDisplayUnits = characteristic.NewTemperatureDisplayUnits()
svc.AddCharacteristic(svc.TemperatureDisplayUnits.Characteristic)
svc.CurrentRelativeHumidity = characteristic.NewCurrentRelativeHumidity()
svc.AddCharacteristic(svc.CurrentRelativeHumidity.Characteristic)
svc.TargetRelativeHumidity = characteristic.NewTargetRelativeHumidity()
svc.AddCharacteristic(svc.TargetRelativeHumidity.Characteristic)
svc.CoolingThresholdTemperature = characteristic.NewCoolingThresholdTemperature()
svc.AddCharacteristic(svc.CoolingThresholdTemperature.Characteristic)
svc.HeatingThresholdTemperature = characteristic.NewHeatingThresholdTemperature()
svc.AddCharacteristic(svc.HeatingThresholdTemperature.Characteristic)
svc.Name = characteristic.NewName()
svc.AddCharacteristic(svc.Name.Characteristic)
return &svc
}