diff --git a/src/tempus/Tempus.py b/src/tempus/Tempus.py index 6aee7cfdf608744bda6aca0d22b27a07ac4fa8c5..d9ae3750a66a57794626b04e58a4bfee659ee2f3 100644 --- a/src/tempus/Tempus.py +++ b/src/tempus/Tempus.py @@ -196,12 +196,13 @@ class Tempus(Device): description="Reset fast-links. This will take about 30 s.", allowedStates={State.ON, State.ACTIVE}) async def resetFastLinks(self): + initial_state = self.State self.state = State.CHANGING self.commandLog = ( "#### Resetting fast-links ####\nThis will take about 30 s.") - self.background_task = background(self._reset_fast_links()) + self.background_task = background(self._reset_fast_links(initial_state)) - async def _reset_fast_links(self): + async def _reset_fast_links(self, initial_state): try: await self.send_command( f"os.system('{self.APP_DIR}/sc_set_gwt_link_up.py -i 0x0 " @@ -211,7 +212,7 @@ class Tempus(Device): "-l 0x0 -s 0x2')", sleep_time=15) self.status = "Fast-links reset done" - self.state = State.INIT + self.state = initial_state except Exception as e: self.handle_execption(e) @@ -220,7 +221,7 @@ class Tempus(Device): displayedName="Configure", description="Run the configuration sequence. This will take about " "30 s.", - allowedStates={State.ON}) + allowedStates={State.ON, State.ACTIVE}) async def configure(self): self.state = State.CHANGING self.status = "Configuring TEMPUS"