Browse Source

prepare for plugin repository

main
Franzi 1 year ago
parent
commit
58aa8673f8
Signed by: kunsi GPG Key ID: 12E3D2136B818350
  1. 15
      octoprint_hd44780/__init__.py
  2. 10
      setup.py

15
octoprint_hd44780/__init__.py

@ -1,7 +1,5 @@
# coding=utf-8
from __future__ import absolute_import
__author__ = "Franziska Kunsmann <hi@kunsmann.eu>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2017 Franziska Kunsmann - Released under terms of the AGPLv3 License"
@ -20,6 +18,7 @@ class LCD_HD44780(octoprint.plugin.StartupPlugin,
self._pin_to_gpio_rev3 = [-1, -1, -1, 2, -1, 3, -1, 4, 14, -1, 15, 17, 18, 27, -1, 22, 23, -1, 24, 10, -1, 9, 25, 11, 8, -1, 7, -1, -1, 5, -1, 6, 12, 13, -1, 19, 16, 26, 20, -1, 21 ]
self._configuredGPIOPins = []
# FIXME hardcoded GPIO pins
self.pin_rs = 15
self.pin_e = 16
self.pin_d4 = 21
@ -95,6 +94,7 @@ class LCD_HD44780(octoprint.plugin.StartupPlugin,
self._configuredGPIOPins = [self._gpio_get_pin(self.pin_rs), self._gpio_get_pin(self.pin_e), self._gpio_get_pin(self.pin_d4), self._gpio_get_pin(self.pin_d5), self._gpio_get_pin(self.pin_d6), self._gpio_get_pin(self.pin_d7)]
# FIXME hardcoded LCD size
self._lcd_send_byte(0x33, self._lcd_cmd)
self._lcd_send_byte(0x32, self._lcd_cmd)
self._lcd_send_byte(0x28, self._lcd_cmd)
@ -146,11 +146,11 @@ class LCD_HD44780(octoprint.plugin.StartupPlugin,
GPIO.output(self._gpio_get_pin(self.pin_d6), GPIO.HIGH)
if bits & 0x80 == 0x80:
GPIO.output(self._gpio_get_pin(self.pin_d7), GPIO.HIGH)
time.sleep(self._lcd_delay)
time.sleep(self._lcd_delay)
GPIO.output(self._gpio_get_pin(self.pin_e), GPIO.HIGH)
time.sleep(self._lcd_pulse)
GPIO.output(self._gpio_get_pin(self.pin_e), GPIO.LOW)
time.sleep(self._lcd_delay)
time.sleep(self._lcd_delay)
GPIO.output(self._gpio_get_pin(self.pin_d4), GPIO.LOW)
GPIO.output(self._gpio_get_pin(self.pin_d5), GPIO.LOW)
GPIO.output(self._gpio_get_pin(self.pin_d6), GPIO.LOW)
@ -163,11 +163,11 @@ class LCD_HD44780(octoprint.plugin.StartupPlugin,
GPIO.output(self._gpio_get_pin(self.pin_d6), GPIO.HIGH)
if bits&0x08==0x08:
GPIO.output(self._gpio_get_pin(self.pin_d7), GPIO.HIGH)
time.sleep(self._lcd_delay)
time.sleep(self._lcd_delay)
GPIO.output(self._gpio_get_pin(self.pin_e), GPIO.HIGH)
time.sleep(self._lcd_pulse)
GPIO.output(self._gpio_get_pin(self.pin_e), GPIO.LOW)
time.sleep(self._lcd_delay)
time.sleep(self._lcd_delay)
def on_printer_add_temperature(self, data):
if not self._ClosedOrError:
@ -209,7 +209,8 @@ class LCD_HD44780(octoprint.plugin.StartupPlugin,
__plugin_name__ = "LCD: HD44780-compatible"
__plugin_author__ = "Kunsi"
__plugin_pythoncompat__ = ">=3,<4"
def __plugin_load__():
global __plugin_implementation__
__plugin_implementation__ = LCD_HD44780()

10
setup.py

@ -1,20 +1,20 @@
# coding=utf-8
import setuptools
########################################################################################################################
########################################################################
plugin_identifier = "hd44780"
plugin_package = "octoprint_%s" % plugin_identifier
plugin_name = "OctoPrint-LCD-HD44780"
plugin_version = "0.1"
plugin_description = "Display useful information on a connected HD44780 compatible display."
plugin_author = "Felix Kunsmann"
plugin_author_email = "felix@kunsmann.eu"
plugin_url = "https://github.com/Kunsi/Octoprint-LCD-HD44780"
plugin_author = "Franziska Kunsmann"
plugin_author_email = "hi@kunsmann.eu"
plugin_url = "https://git.kunsmann.eu/kunsi/Octoprint-LCD-HD44780"
plugin_license = "AGPLv3"
plugin_additional_data = []
########################################################################################################################
########################################################################
def package_data_dirs(source, sub_folders):
import os

Loading…
Cancel
Save