Skip to content

Commit

Permalink
Updated URLs, minor bug fix & version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
farfalleflickan committed Jul 17, 2021
1 parent 4bb3b36 commit f4f45dc
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 31 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You like my work? Feel free to donate :)
Install via the bundled [Plugin Manager](https://github.com/foosel/OctoPrint/wiki/Plugin:-Plugin-Manager)
or manually using this URL:

https://github.com/pastapojken/OctoPrint-Hardwarepwm/archive/master.zip
https://github.com/farfalleflickan/OctoPrint-Hardwarepwm/archive/master.zip


## Configuration
Expand Down
8 changes: 4 additions & 4 deletions extras/hardwarepwm.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ license: AGPLv3

date: 2019-02-08

homepage: https://github.com/pastapojken/OctoPrint-Hardwarepwm
source: https://github.com/pastapojken/OctoPrint-Hardwarepwm
archive: https://github.com/pastapojken/OctoPrint-Hardwarepwm/archive/master.zip
homepage: https://github.com/farfalleflickan/OctoPrint-Hardwarepwm
source: https://github.com/farfalleflickan/OctoPrint-Hardwarepwm
archive: https://github.com/farfalleflickan/OctoPrint-Hardwarepwm/archive/master.zip

tags:
- hardware pwm
Expand All @@ -37,7 +37,7 @@ compatibility:
os:
- linux

python: ">=2.7,<4"
python: ">=3,<4"

---

Expand Down
11 changes: 7 additions & 4 deletions octoprint_hardwarepwm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ def __init__(self):
def startPWM(self, pin, hz, percCycle):
cycle=int(percCycle*10000)
if (self.GPIO.connected):
if (pin==12 or pin==13 or pin==18 or pin==19):
if (pin==18 or pin==19):
self.GPIO.set_mode(pin, pigpio.ALT5)
self.GPIO.hardware_PWM(pin, hz, cycle)
elif (pin==12 or pin==13):
self.GPIO.set_mode(pin, pigpio.ALT0)
self.GPIO.hardware_PWM(pin, hz, cycle)
else:
self._logger.error(str(pin)+" is not a hardware PWM pin.")
else:
Expand Down Expand Up @@ -86,10 +89,10 @@ def get_update_information(self):
displayName="Hardwarepwm Plugin",
displayVersion=self._plugin_version,
type="github_release",
user="pastapojken",
user="farfalleflickan",
repo="OctoPrint-Hardwarepwm",
current=self._plugin_version,
pip="https://github.com/pastapojken/OctoPrint-Hardwarepwm/archive/{target_version}.zip"
pip="https://github.com/farfalleflickan/OctoPrint-Hardwarepwm/archive/{target_version}.zip"
)
)

Expand All @@ -106,7 +109,7 @@ def set_pwm(self):


__plugin_name__ = "hardwarePWM"
__plugin_pythoncompat__ = ">=2.7,<4"
__plugin_pythoncompat__ = ">=3,<4"


def __plugin_load__():
Expand Down
44 changes: 22 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

plugin_name = "OctoPrint-Hardwarepwm"

plugin_version = "0.1.1.3"
plugin_version = "0.1.1.4"

plugin_description = """Raspberry Pi Hardware PWM """

plugin_author = "Daria Rostirolla"

plugin_author_email = "pastapojken@gmail.com"
plugin_author_email = "farfalleflickan@gmail.com"

plugin_url = "https://github.com/pastapojken/OctoPrint-Hardwarepwm"
plugin_url = "https://github.com/farfalleflickan/OctoPrint-Hardwarepwm"

plugin_license = "AGPLv3"

Expand All @@ -31,31 +31,31 @@
from setuptools import setup

try:
import octoprint_setuptools
import octoprint_setuptools
except:
print("Could not import OctoPrint's setuptools, are you sure you are running that under "
"the same python installation that OctoPrint is installed under?")
import sys
sys.exit(-1)
print("Could not import OctoPrint's setuptools, are you sure you are running that under "
"the same python installation that OctoPrint is installed under?")
import sys
sys.exit(-1)

setup_parameters = octoprint_setuptools.create_plugin_setup_parameters(
identifier=plugin_identifier,
package=plugin_package,
name=plugin_name,
version=plugin_version,
description=plugin_description,
author=plugin_author,
mail=plugin_author_email,
url=plugin_url,
license=plugin_license,
requires=plugin_requires,
identifier=plugin_identifier,
package=plugin_package,
name=plugin_name,
version=plugin_version,
description=plugin_description,
author=plugin_author,
mail=plugin_author_email,
url=plugin_url,
license=plugin_license,
requires=plugin_requires,
additional_packages=plugin_additional_packages,
ignored_packages=plugin_ignored_packages,
additional_data=plugin_additional_data
ignored_packages=plugin_ignored_packages,
additional_data=plugin_additional_data
)

if len(additional_setup_parameters):
from octoprint.util import dict_merge
setup_parameters = dict_merge(setup_parameters, additional_setup_parameters)
from octoprint.util import dict_merge
setup_parameters = dict_merge(setup_parameters, additional_setup_parameters)

setup(**setup_parameters)

0 comments on commit f4f45dc

Please sign in to comment.