Skip to content

Commit

Permalink
Revert "Merge branch 'master' of https://github.com/tlachmann/OctoPri…
Browse files Browse the repository at this point in the history
…nt-Enclosure"

This reverts commit 473e2ec, reversing
changes made to 7a53606.
  • Loading branch information
tlachmann committed Jul 27, 2024
1 parent 473e2ec commit 6cc689a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions octoprint_enclosure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
from .getPiTemp import PiTemp
import struct

## Import modifications for Hardware PWM using PiGPIO
import pigpio
##

#Function that returns Boolean output state of the GPIO inputs / outputs
def PinState_Boolean(pin, ActiveLow) :
Expand Down Expand Up @@ -66,7 +69,6 @@ def Pwm_Channel(pin):
else:
raise ValueError("Not a Hardware PWM pin")


class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplatePlugin, octoprint.plugin.SettingsPlugin,
octoprint.plugin.AssetPlugin, octoprint.plugin.BlueprintPlugin,
octoprint.plugin.EventHandlerPlugin):
Expand All @@ -84,7 +86,8 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP
development_mode = False
dummy_value = 30.0
dummy_delta = 0.5



def __init__(self):
# mqtt helper
self.mqtt_publish = lambda *args, **kwargs: None
Expand Down Expand Up @@ -1211,10 +1214,10 @@ def read_dht_temp(self, sensor, pin):
else:
sudo_str = ""
cmd = sudo_str + "python3 " + script + str(sensor) + " " + str(pin)
if self._settings.get(["debug_temperature_log"]) is True:
if self._settings.get(["debug_temperature_log"]) is True:
self._logger.debug("Temperature dht cmd: %s", cmd)
stdout = (Popen(cmd, shell=True, stdout=PIPE).stdout).read()
if self._settings.get(["debug_temperature_log"]) is True:
if self._settings.get(["debug_temperature_log"]) is True:
self._logger.debug("Dht result: %s", stdout)
temp, hum = stdout.decode("utf-8").split("|")
return (self.to_float(temp.strip()), self.to_float(hum.strip()))
Expand Down

0 comments on commit 6cc689a

Please sign in to comment.