kontakt / Octoprint-Filament-Reloaded

GNU General Public License v3.0
44 stars 111 forks source link

Filament Status Indicator #61

Open jouyang3 opened 3 years ago

jouyang3 commented 3 years ago

I am testing the icon indicator in OctoPrint of this plugin. I can read from octoprint.log that the icon is refreshing in interval by changing the DEBUG lines to info in __init__ of updateIcon():

        def updateIcon(self):
            if self.wCurrentState==0:
                self._logger.info("Thread: Update icon 0")
                self.wPluginManager.send_plugin_message(self.wIdentifier, dict(filamentStatus="empty"))
            elif self.wCurrentState==1:
                self._logger.info("Thread: Update icon 1")
                self.wPluginManager.send_plugin_message(self.wIdentifier, dict(filamentStatus="present"))
            elif self.wCurrentState==-1:
                self._logger.info("Thread: Update icon 2")
                self.wPluginManager.send_plugin_message(self.wIdentifier, dict(filamentStatus="unknown"))

The switching is fully functional as indicated in octoprint.log. However, the icon in the navbar in the homepage is not refreshing despite the correct printout atop the send_plugin_message lines are being executed. Can anyone help? I don't know how messages are passed around for a plugin.

Many thanks!