mirror of
https://github.com/nikdoof/hapz2m.git
synced 2026-01-30 10:28:21 +00:00
Introduce constructors for ExposeMapping
This should allow the ExposeMapping struct to be changed without constantly impacting its callers.
This commit is contained in:
@@ -31,13 +31,13 @@ func createClimateServices(dev *Device) (byte, []*service.S, []*ExposeMapping, e
|
||||
s.CurrentTemperature.SetStepValue(0.01)
|
||||
|
||||
svcs = append(svcs, s.S)
|
||||
exposes = append(exposes, &ExposeMapping{&exp, s.CurrentTemperature.C, nil})
|
||||
exposes = append(exposes, NewExposeMapping(&exp, s.CurrentTemperature.C))
|
||||
|
||||
case exp.Name == "humidity":
|
||||
s := service.NewHumiditySensor()
|
||||
s.CurrentRelativeHumidity.SetStepValue(0.01) // ditto, but 1% increments
|
||||
svcs = append(svcs, s.S)
|
||||
exposes = append(exposes, &ExposeMapping{&exp, s.CurrentRelativeHumidity.C, nil})
|
||||
exposes = append(exposes, NewExposeMapping(&exp, s.CurrentRelativeHumidity.C))
|
||||
|
||||
case exp.Name == "pressure":
|
||||
// TODO looks like pressure is not standard in HomeKit
|
||||
|
||||
Reference in New Issue
Block a user