fix: update with fix by @MostHostLA to fetch current values from firmware
https://github.com/SergiuToporjinschi/OctoPrint-CalibrationTools/issues/40#issuecomment-2700107765
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||||
|
|
||||||
import collections
|
from collections.abc import Callable
|
||||||
import re
|
import re
|
||||||
import threading
|
import threading
|
||||||
import traceback
|
import traceback
|
||||||
@@ -69,7 +69,7 @@ class Hooks():
|
|||||||
# Registering a temp event
|
# Registering a temp event
|
||||||
# Trigger a function when the temparature
|
# Trigger a function when the temparature
|
||||||
def registerEventTemp(self, tool, targetTemp, func, *arguments):
|
def registerEventTemp(self, tool, targetTemp, func, *arguments):
|
||||||
if func is None or not isinstance(func, collections.Callable):
|
if func is None or not isinstance(func, Callable):
|
||||||
self._logger.warn("registerEventTemp: Attempt to register event without a function")
|
self._logger.warn("registerEventTemp: Attempt to register event without a function")
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ class Hooks():
|
|||||||
self.registerRegexMsg(reg, func, *arguments)
|
self.registerRegexMsg(reg, func, *arguments)
|
||||||
|
|
||||||
def registerRegexMsg(self, regex, func, *arguments):
|
def registerRegexMsg(self, regex, func, *arguments):
|
||||||
if regex is None or func is None or not isinstance(func, collections.Callable):
|
if regex is None or func is None or not isinstance(func, Callable):
|
||||||
self._logger.warn("registerRegexMsg: Attempt to register gCodeAnswer without a function or regex")
|
self._logger.warn("registerRegexMsg: Attempt to register gCodeAnswer without a function or regex")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user