Skip to content

Commit 34d4f49

Browse files
committed
Added update checks and changed the name slightly
1 parent 3cb0f30 commit 34d4f49

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

octoprint_ender3v2tempfix/__init__.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# coding=utf-8
2+
# All code, with the only exception being formalities and formatting, is made by community member b-morgan,
3+
# because of the issue discussed in this thread;
4+
# https://community.octoprint.org/t/temperature-reporting-now-working-with-new-ender-3-v2/21053
5+
# Distributed with his accept, due to testing limitations
26

7+
from __future__ import absolute_import, unicode_literals
38
import octoprint.plugin
49
import re
510

@@ -20,7 +25,7 @@ def check_for_temp_report(self, comm_instance, line, *args, **kwargs):
2025
self._logger.debug("Original: %s" % line)
2126
m = self.parse_Ender3V2Temp.search(line)
2227
new_line = (" T:%s.%s /%s.%s B:%s.%s /%s.%s" % (
23-
m.group(1), m.group(2), m.group(3), m.group(4), m.group(5), m.group(6), m.group(7), m.group(8)))
28+
m.group(1), m.group(2), m.group(3), m.group(4), m.group(5), m.group(6), m.group(7), m.group(8)))
2429
self._logger.debug("Modified: %s" % new_line)
2530
return new_line
2631

@@ -29,6 +34,21 @@ def TempReport(self, comm_instance, parsed_temperatures, *args, **kwargs):
2934
# self._logger.debug("After: %s" % parsed_temperatures)
3035
return parsed_temperatures
3136

37+
def get_update_information(self, *args, **kwargs):
38+
return dict(
39+
updateplugindemo=dict(
40+
displayName=self._plugin_name,
41+
displayVersion=self._plugin_version,
42+
43+
type="github_release",
44+
current=self._plugin_version,
45+
user="SimplyPrint",
46+
repo="OctoPrint-Ender3V2TempFix",
47+
48+
pip="https://github.com/SimplyPrint/OctoPrint-Ender3V2TempFix/archive/master.zip"
49+
)
50+
)
51+
3252

3353
__plugin_pythoncompat__ = ">=2.7,<4"
3454

@@ -40,5 +60,6 @@ def __plugin_load__():
4060
global __plugin_hooks__
4161
__plugin_hooks__ = {
4262
"octoprint.comm.protocol.temperatures.received": __plugin_implementation__.TempReport,
43-
"octoprint.comm.protocol.gcode.received": __plugin_implementation__.check_for_temp_report
63+
"octoprint.comm.protocol.gcode.received": __plugin_implementation__.check_for_temp_report,
64+
"octoprint.plugin.softwareupdate.check_config": __plugin_implementation__.get_update_information
4465
}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# The plugin's human readable name. Can be overwritten within OctoPrint's internal data via __plugin_name__ in the
1212
# plugin module
13-
plugin_name = "Ender-3 v2 Temp Fix"
13+
plugin_name = "Ender-3 v2 Temperature Fix"
1414

1515
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
1616
plugin_version = "0.0.1"

0 commit comments

Comments
 (0)