Skip to content

Commit 124ca1f

Browse files
committed
Import iOS 10 HomeKit types from Accessory Simulator 2.0 (114.2)
1 parent 2da3b57 commit 124ca1f

38 files changed

+1547
-28
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ Once you've setup HomeKit, you can use Siri to interact with your accessories us
3838
# Clone project
3939
git clone https://github.com/brutella/hklight && cd hklight
4040
41-
# Install dependencies
42-
go get
43-
4441
# Run the project
4542
go run hklightd.go
4643

characteristic/active.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// THIS FILE IS AUTO-GENERATED
2+
package characteristic
3+
4+
const (
5+
ActiveInactive int = 0
6+
ActiveActive int = 1
7+
)
8+
9+
const TypeActive = "B0"
10+
11+
type Active struct {
12+
*Int
13+
}
14+
15+
func NewActive() *Active {
16+
char := NewInt(TypeActive)
17+
char.Format = FormatUInt8
18+
char.Perms = []string{PermRead, PermWrite, PermEvents}
19+
20+
char.SetValue(0)
21+
22+
return &Active{char}
23+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// THIS FILE IS AUTO-GENERATED
2+
package characteristic
3+
4+
const TypeAppMatchingIdentifier = "A4"
5+
6+
type AppMatchingIdentifier struct {
7+
*Bytes
8+
}
9+
10+
func NewAppMatchingIdentifier() *AppMatchingIdentifier {
11+
char := NewBytes(TypeAppMatchingIdentifier)
12+
char.Format = FormatTLV8
13+
char.Perms = []string{PermRead}
14+
15+
char.SetValue([]byte{})
16+
17+
return &AppMatchingIdentifier{char}
18+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// THIS FILE IS AUTO-GENERATED
2+
package characteristic
3+
4+
const (
5+
CurrentAirPurifierStateInactive int = 0
6+
CurrentAirPurifierStateIdle int = 1
7+
CurrentAirPurifierStatePurifyingAir int = 2
8+
)
9+
10+
const TypeCurrentAirPurifierState = "A9"
11+
12+
type CurrentAirPurifierState struct {
13+
*Int
14+
}
15+
16+
func NewCurrentAirPurifierState() *CurrentAirPurifierState {
17+
char := NewInt(TypeCurrentAirPurifierState)
18+
char.Format = FormatUInt8
19+
char.Perms = []string{PermRead, PermEvents}
20+
21+
char.SetValue(0)
22+
23+
return &CurrentAirPurifierState{char}
24+
}

characteristic/current_fan_state.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// THIS FILE IS AUTO-GENERATED
2+
package characteristic
3+
4+
const (
5+
CurrentFanStateInactive int = 0
6+
CurrentFanStateIdle int = 1
7+
CurrentFanStateBlowingAir int = 2
8+
)
9+
10+
const TypeCurrentFanState = "AF"
11+
12+
type CurrentFanState struct {
13+
*Int
14+
}
15+
16+
func NewCurrentFanState() *CurrentFanState {
17+
char := NewInt(TypeCurrentFanState)
18+
char.Format = FormatUInt8
19+
char.Perms = []string{PermRead, PermEvents}
20+
21+
char.SetValue(0)
22+
23+
return &CurrentFanState{char}
24+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// THIS FILE IS AUTO-GENERATED
2+
package characteristic
3+
4+
const (
5+
CurrentHeaterCoolerStateInactive int = 0
6+
CurrentHeaterCoolerStateIdle int = 1
7+
CurrentHeaterCoolerStateHeating int = 2
8+
CurrentHeaterCoolerStateCooling int = 3
9+
)
10+
11+
const TypeCurrentHeaterCoolerState = "B1"
12+
13+
type CurrentHeaterCoolerState struct {
14+
*Int
15+
}
16+
17+
func NewCurrentHeaterCoolerState() *CurrentHeaterCoolerState {
18+
char := NewInt(TypeCurrentHeaterCoolerState)
19+
char.Format = FormatUInt8
20+
char.Perms = []string{PermRead, PermEvents}
21+
22+
char.SetValue(0)
23+
24+
return &CurrentHeaterCoolerState{char}
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// THIS FILE IS AUTO-GENERATED
2+
package characteristic
3+
4+
const (
5+
CurrentHumidifierDehumidifierStateInactive int = 0
6+
CurrentHumidifierDehumidifierStateIdle int = 1
7+
CurrentHumidifierDehumidifierStateHumidifying int = 2
8+
CurrentHumidifierDehumidifierStateDehumidifying int = 3
9+
)
10+
11+
const TypeCurrentHumidifierDehumidifierState = "B3"
12+
13+
type CurrentHumidifierDehumidifierState struct {
14+
*Int
15+
}
16+
17+
func NewCurrentHumidifierDehumidifierState() *CurrentHumidifierDehumidifierState {
18+
char := NewInt(TypeCurrentHumidifierDehumidifierState)
19+
char.Format = FormatUInt8
20+
char.Perms = []string{PermRead, PermEvents}
21+
22+
char.SetValue(0)
23+
24+
return &CurrentHumidifierDehumidifierState{char}
25+
}

characteristic/current_slat_state.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// THIS FILE IS AUTO-GENERATED
2+
package characteristic
3+
4+
const (
5+
CurrentSlatStateFixed int = 0
6+
CurrentSlatStateJammed int = 1
7+
CurrentSlatStateSwinging int = 2
8+
)
9+
10+
const TypeCurrentSlatState = "AA"
11+
12+
type CurrentSlatState struct {
13+
*Int
14+
}
15+
16+
func NewCurrentSlatState() *CurrentSlatState {
17+
char := NewInt(TypeCurrentSlatState)
18+
char.Format = FormatUInt8
19+
char.Perms = []string{PermRead, PermEvents}
20+
21+
char.SetValue(0)
22+
23+
return &CurrentSlatState{char}
24+
}

characteristic/current_tilt_angle.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// THIS FILE IS AUTO-GENERATED
2+
package characteristic
3+
4+
const TypeCurrentTiltAngle = "C1"
5+
6+
type CurrentTiltAngle struct {
7+
*Int
8+
}
9+
10+
func NewCurrentTiltAngle() *CurrentTiltAngle {
11+
char := NewInt(TypeCurrentTiltAngle)
12+
char.Format = FormatInt32
13+
char.Perms = []string{PermRead, PermEvents}
14+
char.SetMinValue(-90)
15+
char.SetMaxValue(90)
16+
char.SetStepValue(1)
17+
char.SetValue(-90)
18+
char.Unit = UnitArcDegrees
19+
20+
return &CurrentTiltAngle{char}
21+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// THIS FILE IS AUTO-GENERATED
2+
package characteristic
3+
4+
const (
5+
FilterChangeIndicationFilterOK int = 0
6+
FilterChangeIndicationChangeFilter int = 1
7+
)
8+
9+
const TypeFilterChangeIndication = "AC"
10+
11+
type FilterChangeIndication struct {
12+
*Int
13+
}
14+
15+
func NewFilterChangeIndication() *FilterChangeIndication {
16+
char := NewInt(TypeFilterChangeIndication)
17+
char.Format = FormatUInt8
18+
char.Perms = []string{PermRead, PermEvents}
19+
20+
char.SetValue(0)
21+
22+
return &FilterChangeIndication{char}
23+
}

characteristic/filter_life_level.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// THIS FILE IS AUTO-GENERATED
2+
package characteristic
3+
4+
const TypeFilterLifeLevel = "AB"
5+
6+
type FilterLifeLevel struct {
7+
*Float
8+
}
9+
10+
func NewFilterLifeLevel() *FilterLifeLevel {
11+
char := NewFloat(TypeFilterLifeLevel)
12+
char.Format = FormatFloat
13+
char.Perms = []string{PermRead, PermEvents}
14+
char.SetMinValue(0)
15+
char.SetMaxValue(100)
16+
17+
char.SetValue(0)
18+
19+
return &FilterLifeLevel{char}
20+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// THIS FILE IS AUTO-GENERATED
2+
package characteristic
3+
4+
const (
5+
LockPhysicalControlsControlLockDisabled int = 0
6+
LockPhysicalControlsControlLockEnabled int = 1
7+
)
8+
9+
const TypeLockPhysicalControls = "A7"
10+
11+
type LockPhysicalControls struct {
12+
*Int
13+
}
14+
15+
func NewLockPhysicalControls() *LockPhysicalControls {
16+
char := NewInt(TypeLockPhysicalControls)
17+
char.Format = FormatUInt8
18+
char.Perms = []string{PermRead, PermWrite, PermEvents}
19+
20+
char.SetValue(0)
21+
22+
return &LockPhysicalControls{char}
23+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// THIS FILE IS AUTO-GENERATED
2+
package characteristic
3+
4+
const TypeNitrogenDioxideDensity = "C4"
5+
6+
type NitrogenDioxideDensity struct {
7+
*Float
8+
}
9+
10+
func NewNitrogenDioxideDensity() *NitrogenDioxideDensity {
11+
char := NewFloat(TypeNitrogenDioxideDensity)
12+
char.Format = FormatFloat
13+
char.Perms = []string{PermRead, PermEvents}
14+
char.SetMinValue(0)
15+
char.SetMaxValue(1000)
16+
char.SetStepValue(1)
17+
char.SetValue(0)
18+
19+
return &NitrogenDioxideDensity{char}
20+
}

characteristic/ozone_density.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// THIS FILE IS AUTO-GENERATED
2+
package characteristic
3+
4+
const TypeOzoneDensity = "C3"
5+
6+
type OzoneDensity struct {
7+
*Float
8+
}
9+
10+
func NewOzoneDensity() *OzoneDensity {
11+
char := NewFloat(TypeOzoneDensity)
12+
char.Format = FormatFloat
13+
char.Perms = []string{PermRead, PermEvents}
14+
char.SetMinValue(0)
15+
char.SetMaxValue(1000)
16+
char.SetStepValue(1)
17+
char.SetValue(0)
18+
19+
return &OzoneDensity{char}
20+
}

characteristic/pm10_density.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// THIS FILE IS AUTO-GENERATED
2+
package characteristic
3+
4+
const TypePM10Density = "C7"
5+
6+
type PM10Density struct {
7+
*Float
8+
}
9+
10+
func NewPM10Density() *PM10Density {
11+
char := NewFloat(TypePM10Density)
12+
char.Format = FormatFloat
13+
char.Perms = []string{PermRead, PermEvents}
14+
char.SetMinValue(0)
15+
char.SetMaxValue(1000)
16+
char.SetStepValue(1)
17+
char.SetValue(0)
18+
19+
return &PM10Density{char}
20+
}

characteristic/pm2_5_density.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// THIS FILE IS AUTO-GENERATED
2+
package characteristic
3+
4+
const TypePM2_5Density = "C6"
5+
6+
type PM2_5Density struct {
7+
*Float
8+
}
9+
10+
func NewPM2_5Density() *PM2_5Density {
11+
char := NewFloat(TypePM2_5Density)
12+
char.Format = FormatFloat
13+
char.Perms = []string{PermRead, PermEvents}
14+
char.SetMinValue(0)
15+
char.SetMaxValue(1000)
16+
char.SetStepValue(1)
17+
char.SetValue(0)
18+
19+
return &PM2_5Density{char}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// THIS FILE IS AUTO-GENERATED
2+
package characteristic
3+
4+
const TypeRelativeHumidityDehumidifierThreshold = "C9"
5+
6+
type RelativeHumidityDehumidifierThreshold struct {
7+
*Float
8+
}
9+
10+
func NewRelativeHumidityDehumidifierThreshold() *RelativeHumidityDehumidifierThreshold {
11+
char := NewFloat(TypeRelativeHumidityDehumidifierThreshold)
12+
char.Format = FormatFloat
13+
char.Perms = []string{PermRead, PermWrite, PermEvents}
14+
char.SetMinValue(0)
15+
char.SetMaxValue(100)
16+
char.SetStepValue(1)
17+
char.SetValue(0)
18+
19+
return &RelativeHumidityDehumidifierThreshold{char}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// THIS FILE IS AUTO-GENERATED
2+
package characteristic
3+
4+
const TypeRelativeHumidityHumidifierThreshold = "CA"
5+
6+
type RelativeHumidityHumidifierThreshold struct {
7+
*Float
8+
}
9+
10+
func NewRelativeHumidityHumidifierThreshold() *RelativeHumidityHumidifierThreshold {
11+
char := NewFloat(TypeRelativeHumidityHumidifierThreshold)
12+
char.Format = FormatFloat
13+
char.Perms = []string{PermRead, PermWrite, PermEvents}
14+
char.SetMinValue(0)
15+
char.SetMaxValue(100)
16+
char.SetStepValue(1)
17+
char.SetValue(0)
18+
19+
return &RelativeHumidityHumidifierThreshold{char}
20+
}

0 commit comments

Comments
 (0)