Hi,
I'm working on a plugin, but can't get the initial data to pass from server to js viewmodel after the server starts.
# server
class HelloworldPlugin(octoprint.plugin.StartupPlugin,
octoprint.plugin.TemplatePlugin,
octoprint.plugin.SettingsPlugin,
octoprint.plugin.AssetPlugin,
octoprint.plugin.EventHandlerPlugin,
octoprint.plugin.ProgressPlugin):
def __init__(self):
self._filaments = None
def on_after_startup(self):
self._plugin_manager.send_plugin_message(self._identifier, dict(filaments=self._filaments))
// client
self.onBeforeBinding = function() {
console.log("HI before binding"); // <- this is printed in console
}
self.onStartupComplete = function() {
console.log("HI after startup"); // <- this is printed in console
}
self.onDataUpdaterPluginMessage = function(plugin, data) {
console.log("HELLO plugin: " + plugin); // <- this is NOT printed in the console. Why??
if (plugin != "helloworld" || !data) {
return;
}
}
onDataUpdaterPluginMessage is not called. Why?
Btw, plugin is registered and server starts without errors.