ok, so I have figured out why the endpoint gets called more than once.
short story: there are calls in the accumulator template that indirectly call the endpoint multiple times
long story:
In the accumulator.html template there is a call to a generator function (post_option found in eai.py) that makes the call to the endpoint. Each time this generator is called it does a getEntity() call.
the generator has this form
element['options']
Commenting out the first call results in a single call to the endpoint. The reason I asked this question in the first place is that each of these calls could be expensive, both in terms of doing what ever the endpoint does and the user experience in terms of page render times. Since the call is made twice, and in my case it takes approximately 13s to return results, the user has to wait a minimum of 26s for the page to render (actually it's longer than this but I am not including the time it takes for the back-end to render all the results, button, text inputs, etc.).
What I have found through my limited testing is that converting all but the first generator call to use the results from the first call reduces the number of calls to the endpoint to 1 and the setup page still has the same data presented as it should. ie. selected elements are selected when updating an existing configuration.
Looks like I need to open an enhancement request to get the number of calls to the generator reduced, if possible.
... View more