mirror of
https://github.com/nikdoof/hapz2m.git
synced 2026-01-30 06:58:14 +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:
@@ -22,10 +22,10 @@ func createContactServices(dev *Device) (byte, []*service.S, []*ExposeMapping, e
|
||||
s := service.NewContactSensor()
|
||||
|
||||
svcs = append(svcs, s.S)
|
||||
exposes = append(exposes, &ExposeMapping{&exp, s.ContactSensorState.C,
|
||||
exposes = append(exposes, NewTranslatedExposeMapping(&exp, s.ContactSensorState.C,
|
||||
&BoolTranslator{
|
||||
characteristic.ContactSensorStateContactNotDetected,
|
||||
characteristic.ContactSensorStateContactDetected}})
|
||||
characteristic.ContactSensorStateContactDetected}))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user