Update __init__.py

This commit is contained in:
PeterGribbin
2022-05-02 13:06:58 +01:00
committed by GitHub
parent 0f9c331d1b
commit 839c0edb3a

View File

@@ -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: