From 3a48706cc8554ba346cfcd374bf948c484f7b93f Mon Sep 17 00:00:00 2001 From: rfmitchem Date: Thu, 12 Jan 2023 15:49:45 -0500 Subject: [PATCH] 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)