From cbfea9fcf5a5182e1d1f6dcaf46c7f15d6a17e2e Mon Sep 17 00:00:00 2001 From: Thorsten Lachmann Date: Fri, 19 Jul 2024 01:00:05 +0200 Subject: [PATCH] Revert "Merge remote-tracking branch 'wmonzel1/HardwarePWM'" This reverts commit 4f8b8269e1cf60a1ea6f84d69d22f77ca94544cd, reversing changes made to d2f10416fd8a942b069d393d2964eae1c77d1d9b. --- octoprint_enclosure/__init__.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/octoprint_enclosure/__init__.py b/octoprint_enclosure/__init__.py index a27abb0..72d8376 100644 --- a/octoprint_enclosure/__init__.py +++ b/octoprint_enclosure/__init__.py @@ -25,9 +25,6 @@ from smbus2 import SMBus 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) : @@ -44,7 +41,6 @@ def PinState_Human(pin, ActiveLow): PinState = PinState_Boolean(pin, ActiveLow) if PinState == True : return " ON " - elif PinState == False: elif PinState == False: return " OFF " else: @@ -59,7 +55,6 @@ def CheckInputActiveLow(Input_Pull_Resistor): else: return False - class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplatePlugin, octoprint.plugin.SettingsPlugin, octoprint.plugin.AssetPlugin, octoprint.plugin.BlueprintPlugin, octoprint.plugin.EventHandlerPlugin): @@ -336,7 +331,7 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP if rpi_output['output_type'] == 'regular': index = self.to_int(rpi_output['index_id']) label = rpi_output['label'] - pin = self.to_int(rpi_output['gpio_pin']) + pin = self.to_int(rpi_output['gpio_pin']) ActiveLow = rpi_output['active_low'] if rpi_output['gpio_i2c_enabled']: b = self.gpio_i2c_input(rpi_output, ActiveLow) @@ -1405,7 +1400,7 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.TemplateP else: calculated_duty = 0 - self.write_hwpwm(gpio_pin, self.constrain(calculated_duty, 0, 100)) + self.write_pwm(gpio_pin, self.constrain(calculated_duty, 0, 100)) except Exception as ex: self.log_error(ex)