Revert "#6 UI Updates senden und anzeigen"
This reverts commit f83d4259
This commit is contained in:
parent
f83d425915
commit
b3b0329e50
@ -56,12 +56,8 @@ 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)
|
||||||
if request.status_code == 200:
|
self._plugin_manager.send_plugin_message(self._identifier,
|
||||||
self._logger.debug("update view")
|
request.json())
|
||||||
self._logger.debug(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
|
||||||
|
@ -129,20 +129,14 @@ $(function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.onEventPrinterStateChanged = function(payload) {
|
|
||||||
if (payload.state_id == "PRINTING" || payload.state_id == "PAUSED"){
|
|
||||||
self.testButtonChangeStatus(true);
|
|
||||||
} else {
|
|
||||||
self.testButtonChangeStatus(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
self.mystromswitchEnabled.subscribe(self.onmystromswitchEvent, self);
|
self.mystromswitchEnabled.subscribe(self.onmystromswitchEvent, self);
|
||||||
|
|
||||||
self.onDataUpdaterPluginMessage = function(plugin, data) {
|
self.onDataUpdaterPluginMessage = function(plugin, data) {
|
||||||
if (plugin != "mystromswitch" && plugin != "octoprint_mystromswitch") {
|
if (plugin != "mystromswitch" && plugin != "octoprint_mystromswitch") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.mystromswitchEnabled(data.mystromswitchEnabled);
|
||||||
if (data.power != null) {
|
if (data.power != null) {
|
||||||
self.timeoutPopupOptions.text = self.timeoutPopupText + data.power;
|
self.timeoutPopupOptions.text = self.timeoutPopupText + data.power;
|
||||||
if (typeof self.timeoutPopup != "undefined") {
|
if (typeof self.timeoutPopup != "undefined") {
|
||||||
|
Loading…
Reference in New Issue
Block a user