#6 UI Updates senden und anzeigen

This commit is contained in:
David Zingg 2019-11-20 21:08:54 +01:00
parent 3c35554740
commit 1cab3457a7
2 changed files with 7 additions and 8 deletions

View File

@ -56,8 +56,9 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
try: try:
request = requests.get( request = requests.get(
'http://{}/report'.format(self.ip), timeout=1) 'http://{}/report'.format(self.ip), timeout=1)
self._plugin_manager.send_plugin_message(self._identifier, self._logger.debug(request.json())
request.json()) #self._plugin_manager.send_plugin_message(self._identifier,
# request.json())
except (requests.exceptions.ConnectionError, ValueError): except (requests.exceptions.ConnectionError, ValueError):
self._logger.info('Connection Error Host: {}'.format(self.ip)) self._logger.info('Connection Error Host: {}'.format(self.ip))
# Do all Staff here # Do all Staff here
@ -73,11 +74,6 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
self._logger.info("on_settings_load") self._logger.info("on_settings_load")
self.initialize() self.initialize()
def on_settings_migrate(self, target, current):
if current >= target:
return
pass
def get_settings_version(self): def get_settings_version(self):
return 1 return 1

View File

@ -1,3 +1,6 @@
<div class="sidebar_plugin_mystromswitch"> <div class="sidebar_plugin_mystromswitch">
<label class="checkbox">
<input type="checkbox" data-bind="enable: loginState.isUser(), checked: mystromswitchEnabled">
{{ _('Shutdown Printer after print finishes') }}
</label>
</div> </div>