From 3a48706cc8554ba346cfcd374bf948c484f7b93f Mon Sep 17 00:00:00 2001 From: rfmitchem Date: Thu, 12 Jan 2023 15:49:45 -0500 Subject: [PATCH 1/3] updated getDHTTemp to output stdout contents --- octoprint_enclosure/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/octoprint_enclosure/__init__.py b/octoprint_enclosure/__init__.py index 72d8376..3453d2d 100644 --- a/octoprint_enclosure/__init__.py +++ b/octoprint_enclosure/__init__.py @@ -1150,9 +1150,11 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP stdout = (Popen(cmd, shell=True, stdout=PIPE).stdout).read() if self._settings.get(["debug_temperature_log"]) is True: self._logger.debug("Dht result: %s", stdout) - temp, hum = stdout.decode("utf-8").split("|") + stdoutContents = stdout.decode("utf-8) + temp, hum = stdoutContents.split("|") return (self.to_float(temp.strip()), self.to_float(hum.strip())) except Exception as ex: + self._logger.info(f"Stdout Contents: {stdoutContents}") self._logger.info( "Failed to execute python scripts, try disabling use SUDO on advanced section of the plugin.") self.log_error(ex) From 68bc525b08c442492dd956b2bbfa09e61d84224f Mon Sep 17 00:00:00 2001 From: rfmitchem Date: Thu, 12 Jan 2023 15:54:38 -0500 Subject: [PATCH 2/3] Create python-publish.yml --- .github/workflows/python-publish.yml | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..bdaab28 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,39 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} From 7343fe99aa84441b67ad55fe19339e4b6f7d35c7 Mon Sep 17 00:00:00 2001 From: rfmitchem Date: Thu, 12 Jan 2023 16:11:54 -0500 Subject: [PATCH 3/3] Update python-publish.yml --- .github/workflows/python-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index bdaab28..2bd539f 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -29,6 +29,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip + pip install octoprint_setuptools pip install build - name: Build package run: python -m build