Skip to content

Commit

Permalink
Add software update hook
Browse files Browse the repository at this point in the history
  • Loading branch information
foosel committed Mar 27, 2020
1 parent feeba84 commit bab5642
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions octoprint_firmware_check/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,25 @@ def get_additional_permissions(self):
default_groups=[USER_GROUP])
]

##~~ Softwareupdate hook

def get_update_information(self):
return dict(
fixcbdfirmware=dict(
displayName="Firmware Check Plugin",
displayVersion=self._plugin_version,

# version check: github repository
type="github_release",
user="OctoPrint",
repo="OctoPrint-FirmwareCheck",
current=self._plugin_version,

# update method: pip
pip="https://github.com/OctoPrint/OctoPrint-FirmwareCheck/archive/{target_version}.zip"
)
)

##~~ Helpers

def _run_checks(self, check_type, *args, **kwargs):
Expand Down Expand Up @@ -204,6 +223,7 @@ def register_custom_events(*args, **kwargs):
"issue or otherwise broken firmware and inform you about that fact.")
__plugin_implementation__ = FirmwareCheckPlugin()
__plugin_hooks__ = {
"octoprint.plugin.softwareupdate.check_config": __plugin_implementation__.get_update_information,
"octoprint.comm.protocol.gcode.received": (__plugin_implementation__.on_gcode_received, 100),
"octoprint.comm.protocol.firmware.info": (__plugin_implementation__.on_firmware_info_received, 100),
"octoprint.comm.protocol.firmware.capabilities": (__plugin_implementation__.on_firmware_cap_received, 100),
Expand Down

0 comments on commit bab5642

Please sign in to comment.