Lead by other examples I try to implement the hook like this:
class LedStripePlugin(octoprint.plugin.StartupPlugin,
octoprint.plugin.ShutdownPlugin):
....
def ReadTemperature(self, comm_instance, parsed_temperatures, *args, **kwargs):
self._logger.info("ToolTemp, %s" % parsed_temperatures)
def __plugin_load__():
global __plugin_implementation__
__plugin_implementation__ = LedStripePlugin()
global __plugin_hooks__
__plugin_hooks__ = {
"octoprint.comm.protocol.temperatures.received": __plugin_implementation__.ReadTemperature
}
In the result the data are shown in the log, but no temp graph & data are shown in the GUI.
What I didn't get handling hooks?
The hook returns the dictionary: (LogInfo Printout, tested with the simulator)
2020-04-07 12:20:32,210 - octoprint.plugins.LedStripePlugin - INFO - ToolTemp, {'B': (21.3, 0.0), 'T0': (21.3, 0.0)}
No further warnings or errors found in the log, but the GUI doesn't show the graphs and no temperatures. Without this hook all temperatures and graphs are shown..
The hook handler as shared above doesn't return anything. It logs something, but it doesn't return anything from the function itself. OctoPrint thus assumes your hook has deemed all temperature data invalid and doesn't show anything.