Skip to content

Commit

Permalink
Expand endpoints list param into scalar ip and port
Browse files Browse the repository at this point in the history
  • Loading branch information
GDYendell committed May 10, 2024
1 parent 24cc4ad commit 60c0ae0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/src/odin_data/control/odin_data_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,15 @@ def __init__(self, name, endpoints, update_interval=0.5):
_tree = {
"api": (lambda: self._api, None, {}),
"module": (lambda: self._name, None, {}),
"endpoints": (lambda: self._endpoints, None, {}),
"endpoints": [],
"count": (lambda: len(self._clients), None, {}),
"update_interval": (lambda: self._update_interval, None, {}),
}
for idx, endpoint in enumerate(self._endpoints):
_tree["endpoints"].append(
# Note the default here binds unique variables into each closure
{k: (lambda v=v: v, None, {}) for k, v in endpoint.items()}
)
for idx, _client in enumerate(self._clients):
_tree[str(idx)] = {
"status": {"error": (lambda: self._error, None, {})},
Expand Down

0 comments on commit 60c0ae0

Please sign in to comment.