Skip to content

Commit

Permalink
Decades: Fix: Call super().__init__() before requesting params
Browse files Browse the repository at this point in the history
Technically this is a race condition as it stands.
  • Loading branch information
alexdewar committed Nov 25, 2024
1 parent ccd8d3d commit 038faeb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions finesse/hardware/plugins/sensors/decades.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,13 @@ def __init__(
self._params: list[DecadesParameter]
"""Parameters returned by the server."""

super().__init__(poll_interval, start_polling=False)

# Obtain full parameter list in order to parse received data
self.obtain_parameter_list(
frozenset(params.split(",")) if params else frozenset()
)

# We only want to start polling after we have loaded the parameter list
super().__init__(poll_interval, start_polling=False)

def obtain_parameter_list(self, params: Set[str]) -> None:
"""Request the parameter list from the DECADES server and wait for response."""
self._requester.make_request(
Expand Down

0 comments on commit 038faeb

Please sign in to comment.