예제 #1
0
파일: door_state.go 프로젝트: applefreak/hc
func (s *DoorState) DoorState() model.DoorStateType {
	return model.DoorStateType(s.Byte())
}
예제 #2
0
func (o *garageDoorOpener) OnTargetStateChange(fn func(model.DoorStateType)) {
	o.garageDoorOpener.TargetState.OnConnChange(func(conn net.Conn, c *characteristic.Characteristic, new, old interface{}) {
		fn(model.DoorStateType(new.(byte)))
	})
}