From 839c0edb3ae0ee3905b2cc52d805f806786da23b Mon Sep 17 00:00:00 2001 From: PeterGribbin <104760870+PeterGribbin@users.noreply.github.com> Date: Mon, 2 May 2022 13:06:58 +0100 Subject: [PATCH] Update __init__.py --- octoprint_enclosure/__init__.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/octoprint_enclosure/__init__.py b/octoprint_enclosure/__init__.py index 72d8376..075ae2d 100644 --- a/octoprint_enclosure/__init__.py +++ b/octoprint_enclosure/__init__.py @@ -23,6 +23,7 @@ import json import copy from smbus2 import SMBus from .getPiTemp import PiTemp +from .novus1040 import NovusTemp import struct @@ -1290,6 +1291,19 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP "Failed to get pi cpu temperature") self.log_error(ex) return 0 + + def read_novus_temp(self): + try: + novustemp = NovusTemp() + temp = novustemp.getTemp() + if self._settings.get(["debug_temperature_log"]) is True: + self._logger.debug("Novus PV: %s", temp) + return temp + except Exception as ex: + self._logger.info( + "Failed to get Novus temperature") + self.log_error(ex) + return 0 def read_si7021_temp(self, address, i2cbus): try: