From 03d3dfb496c5d33e56af51c871be2fdc38d165bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 11 Oct 2021 15:50:43 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=92=9A=20Hopefully=20fix=20E2E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ubuntu-latest *should* work I hope. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae1f20280..bc97af96e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -95,7 +95,7 @@ jobs: test-e2e: name: 🧪 E2E tests needs: build - runs-on: ubuntu-16.04 + runs-on: ubuntu-latest steps: - name: ⬇ Checkout code uses: actions/checkout@v2 From 24e877011906f54490d57a89fae0aab850d022cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 12 Oct 2021 15:44:57 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A5=85=20Put=20capability=20parsing?= =?UTF-8?q?=20before=20firmware=20parsing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise a capability in NAME: won't be possible to parse. --- src/octoprint/util/comm.py | 104 ++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 315b7a7ce..bdab6544b 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -2642,6 +2642,58 @@ class MachineCom(object): except ValueError: pass + ##~~ Firmware capability report triggered by M115 + elif lower_line.startswith("cap:"): + parsed = parse_capability_line(lower_line) + if parsed is not None: + capability, enabled = parsed + self._firmware_capabilities[capability] = enabled + + if self._capability_support.get(capability, False): + if capability == self.CAPABILITY_AUTOREPORT_TEMP and enabled: + self._logger.info( + "Firmware states that it supports temperature autoreporting" + ) + self._set_autoreport_temperature_interval() + elif ( + capability == self.CAPABILITY_AUTOREPORT_SD_STATUS + and enabled + ): + self._logger.info( + "Firmware states that it supports sd status autoreporting" + ) + self._set_autoreport_sdstatus_interval() + elif capability == self.CAPABILITY_AUTOREPORT_POS and enabled: + self._logger.info( + "Firmware states that it supports position autoreporting" + ) + self._set_autoreport_pos_interval() + elif ( + capability == self.CAPABILITY_EMERGENCY_PARSER and enabled + ): + self._logger.info( + "Firmware states that it supports emergency GCODEs to be sent without waiting for an acknowledgement first" + ) + + # notify plugins + for name, hook in self._firmware_info_hooks[ + "capabilities" + ].items(): + try: + hook( + self, + capability, + enabled, + copy.copy(self._firmware_capabilities), + ) + except Exception: + self._logger.exception( + "Error processing firmware capability hook {}:".format( + name + ), + extra={"plugin": name}, + ) + ##~~ firmware name & version elif "NAME:" in line or line.startswith("NAME."): # looks like a response to M115 @@ -2762,58 +2814,6 @@ class MachineCom(object): firmware_name, copy.copy(data) ) - ##~~ Firmware capability report triggered by M115 - elif lower_line.startswith("cap:"): - parsed = parse_capability_line(lower_line) - if parsed is not None: - capability, enabled = parsed - self._firmware_capabilities[capability] = enabled - - if self._capability_support.get(capability, False): - if capability == self.CAPABILITY_AUTOREPORT_TEMP and enabled: - self._logger.info( - "Firmware states that it supports temperature autoreporting" - ) - self._set_autoreport_temperature_interval() - elif ( - capability == self.CAPABILITY_AUTOREPORT_SD_STATUS - and enabled - ): - self._logger.info( - "Firmware states that it supports sd status autoreporting" - ) - self._set_autoreport_sdstatus_interval() - elif capability == self.CAPABILITY_AUTOREPORT_POS and enabled: - self._logger.info( - "Firmware states that it supports position autoreporting" - ) - self._set_autoreport_pos_interval() - elif ( - capability == self.CAPABILITY_EMERGENCY_PARSER and enabled - ): - self._logger.info( - "Firmware states that it supports emergency GCODEs to be sent without waiting for an acknowledgement first" - ) - - # notify plugins - for name, hook in self._firmware_info_hooks[ - "capabilities" - ].items(): - try: - hook( - self, - capability, - enabled, - copy.copy(self._firmware_capabilities), - ) - except Exception: - self._logger.exception( - "Error processing firmware capability hook {}:".format( - name - ), - extra={"plugin": name}, - ) - ##~~ invalid extruder elif "invalid extruder" in lower_line: tool = None