diff --git a/README.md b/README.md index 84d4e75..bf760aa 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you have questions or encounter issues please take a look at the [Frequently 1. Install this plugin via the bundled [Plugin Manager](https://github.com/foosel/OctoPrint/wiki/Plugin:-Plugin-Manager) or manually using this URL: - `https://github.com/malnvenshorn/OctoPrint-FilamentManager/archive/master.zip` + `https://github.com/oschwartz10612/OctoPrint-FilamentManager/archive/master.zip` 1. For PostgreSQL support you need to install an additional dependency: diff --git a/octoprint_filamentmanager/__init__.py b/octoprint_filamentmanager/__init__.py index 3988788..e5635e0 100644 --- a/octoprint_filamentmanager/__init__.py +++ b/octoprint_filamentmanager/__init__.py @@ -351,7 +351,7 @@ def get_update_information(self): current=self._plugin_version, # update method: pip - pip="https://github.com/malnvenshorn/OctoPrint-FilamentManager/archive/{target_version}.zip" + pip="https://github.com/oschwartz10612/OctoPrint-FilamentManager/archive/{target_version}.zip" ) ) diff --git a/octoprint_filamentmanager/api/__init__.py b/octoprint_filamentmanager/api/__init__.py index 94e0724..b671230 100644 --- a/octoprint_filamentmanager/api/__init__.py +++ b/octoprint_filamentmanager/api/__init__.py @@ -21,9 +21,11 @@ from .util import * - class FilamentManagerApi(octoprint.plugin.BlueprintPlugin): + def send_client_message(self, message_type, data=None): + self._plugin_manager.send_plugin_message(self._identifier, dict(type=message_type, data=data)) + @octoprint.plugin.BlueprintPlugin.route("/profiles", methods=["GET"]) def get_profiles_list(self): force = request.values.get("force", "false") in valid_boolean_trues @@ -199,6 +201,12 @@ def create_spool(self): try: saved_spool = self.filamentManager.create_spool(new_spool) + + if "update" in json_data: + update = json_data["update"] + if update == True: + self.send_client_message("data_changed", data=dict(table="spools", action="update")) + return jsonify(dict(spool=saved_spool)) except Exception as e: self._logger.error("Failed to create spool: {message}".format(message=str(e))) @@ -288,6 +296,12 @@ def update_selection(self, identifier): try: saved_selection = self.filamentManager.update_selection(identifier, self.client_id, selection) + + if "update" in json_data: + update = json_data["update"] + if update == True: + self.send_client_message("data_changed", data=dict(table="spools", action="update")) + except Exception as e: self._logger.error("Failed to update selected spool for tool{id}: {message}" .format(id=str(identifier), message=str(e))) diff --git a/setup.py b/setup.py index 5075e2e..d3b8ff2 100644 --- a/setup.py +++ b/setup.py @@ -6,11 +6,11 @@ plugin_identifier = "filamentmanager" plugin_package = "octoprint_filamentmanager" plugin_name = "OctoPrint-FilamentManager" -plugin_version = "0.5.3" +plugin_version = "0.5.4" plugin_description = "Manage your spools and keep track of remaining filament on them" plugin_author = "Sven Lohrmann" -plugin_author_email = "malnvenshorn@gmail.com" -plugin_url = "https://github.com/malnvenshorn/OctoPrint-FilamentManager" +plugin_author_email = "oschwartz10612@gmail.com" +plugin_url = "https://github.com/oschwartz10612/OctoPrint-FilamentManager" plugin_license = "AGPLv3" plugin_requires = ["backports.csv>=1.0.5,<1.1", "uritools>=2.1,<2.2",