2017-08-18 12:17:26 +02:00
|
|
|
# coding=utf-8
|
|
|
|
from __future__ import absolute_import
|
|
|
|
|
|
|
|
__author__ = "Sven Lohrmann <malnvenshorn@gmail.com>"
|
|
|
|
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
|
|
|
|
__copyright__ = "Copyright (C) 2017 Sven Lohrmann - Released under terms of the AGPLv3 License"
|
|
|
|
|
|
|
|
import octoprint.plugin
|
|
|
|
|
|
|
|
|
2017-08-18 17:18:30 +02:00
|
|
|
class WebcamTabPlugin(octoprint.plugin.AssetPlugin,
|
2017-08-18 12:17:26 +02:00
|
|
|
octoprint.plugin.TemplatePlugin):
|
|
|
|
|
|
|
|
# AssetPlugin mixin
|
|
|
|
|
|
|
|
def get_assets(self):
|
|
|
|
return dict(
|
|
|
|
js=["js/webcamtab.js"]
|
|
|
|
)
|
|
|
|
|
2017-08-18 17:18:30 +02:00
|
|
|
# TemplatePlugin
|
|
|
|
|
|
|
|
def get_template_configs(self):
|
|
|
|
return [
|
2018-01-13 14:09:23 +01:00
|
|
|
dict(type="tab", name="Webcam", template=None)
|
2017-08-18 17:18:30 +02:00
|
|
|
]
|
|
|
|
|
2017-08-18 12:17:26 +02:00
|
|
|
# Softwareupdate hook
|
|
|
|
|
|
|
|
def get_update_information(self):
|
|
|
|
return dict(
|
|
|
|
webcamtab=dict(
|
|
|
|
displayName="Webcam Tab",
|
|
|
|
displayVersion=self._plugin_version,
|
|
|
|
|
|
|
|
# version check: github repository
|
|
|
|
type="github_release",
|
|
|
|
user="malnvenshorn",
|
|
|
|
repo="OctoPrint-WebcamTab",
|
|
|
|
current=self._plugin_version,
|
|
|
|
|
|
|
|
# update method: pip
|
|
|
|
pip="https://github.com/malnvenshorn/OctoPrint-WebcamTab/archive/{target_version}.zip"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
__plugin_name__ = "Webcam Tab"
|
2020-03-29 18:59:26 +02:00
|
|
|
__plugin_pythoncompat__ = ">=2.7,<4"
|
2017-08-18 12:17:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
def __plugin_load__():
|
|
|
|
global __plugin_implementation__
|
|
|
|
__plugin_implementation__ = WebcamTabPlugin()
|
|
|
|
|
|
|
|
global __plugin_hooks__
|
|
|
|
__plugin_hooks__ = {
|
|
|
|
"octoprint.plugin.softwareupdate.check_config": __plugin_implementation__.get_update_information
|
|
|
|
}
|