OctoPrint-ExtraDistance/octoprint_extradistance/__init__.py
2017-11-22 13:45:43 +10:00

65 lines
1.8 KiB
Python

# coding=utf-8
from __future__ import absolute_import
import octoprint.plugin
class ExtraDistancePlugin(octoprint.plugin.SettingsPlugin,
octoprint.plugin.AssetPlugin,
octoprint.plugin.TemplatePlugin):
##~~ SettingsPlugin mixin
def get_settings_defaults(self):
return dict(
# put your plugin's default settings here
)
##~~ AssetPlugin mixin
def get_assets(self):
# Define your plugin's asset files to automatically include in the
# core UI here.
return dict(
js=["js/extradistance.js"],
css=["css/extradistance.css"],
less=["less/extradistance.less"]
)
##~~ Softwareupdate hook
def get_update_information(self):
# Define the configuration for your plugin to use with the Software Update
# Plugin here. See https://github.com/foosel/OctoPrint/wiki/Plugin:-Software-Update
# for details.
return dict(
unknown=dict(
displayName="Extra Distance Buttons",
displayVersion=self._plugin_version,
# version check: github repository
type="github_release",
user="ntoff",
repo="OctoPrint-ExtraDistance",
current=self._plugin_version,
# update method: pip
pip="https://github.com/ntoff/OctoPrint-ExtraDistance/archive/{target_version}.zip"
)
)
# If you want your plugin to be registered within OctoPrint under a different name than what you defined in setup.py
# ("OctoPrint-PluginSkeleton"), you may define that here. Same goes for the other metadata derived from setup.py that
# can be overwritten via __plugin_xyz__ control properties. See the documentation for that.
__plugin_name__ = "Extra Distance Buttons"
def __plugin_load__():
global __plugin_implementation__
__plugin_implementation__ = ExtraDistancePlugin()
global __plugin_hooks__
__plugin_hooks__ = {
"octoprint.plugin.softwareupdate.check_config": __plugin_implementation__.get_update_information
}