diff --git a/octoprint_enclosure/__init__.py b/octoprint_enclosure/__init__.py index dc89f00..e1bb2d7 100644 --- a/octoprint_enclosure/__init__.py +++ b/octoprint_enclosure/__init__.py @@ -23,6 +23,8 @@ class EnclosurePlugin(octoprint.plugin.StartupPlugin, octoprint.plugin.BlueprintPlugin, octoprint.plugin.EventHandlerPlugin): + + previous_temp_control_status = False current_temp_control_status = False enclosure_set_temperature = 0.0 diff --git a/octoprint_enclosure/static/css/bootstrap-colorpicker.css b/octoprint_enclosure/static/css/bootstrap-colorpicker.css old mode 100644 new mode 100755 diff --git a/octoprint_enclosure/static/img/bootstrap-colorpicker/alpha-horizontal.png b/octoprint_enclosure/static/img/bootstrap-colorpicker/alpha-horizontal.png old mode 100644 new mode 100755 diff --git a/octoprint_enclosure/static/img/bootstrap-colorpicker/alpha.png b/octoprint_enclosure/static/img/bootstrap-colorpicker/alpha.png old mode 100644 new mode 100755 diff --git a/octoprint_enclosure/static/img/bootstrap-colorpicker/hue-horizontal.png b/octoprint_enclosure/static/img/bootstrap-colorpicker/hue-horizontal.png old mode 100644 new mode 100755 diff --git a/octoprint_enclosure/static/img/bootstrap-colorpicker/hue.png b/octoprint_enclosure/static/img/bootstrap-colorpicker/hue.png old mode 100644 new mode 100755 diff --git a/octoprint_enclosure/static/img/bootstrap-colorpicker/saturation.png b/octoprint_enclosure/static/img/bootstrap-colorpicker/saturation.png old mode 100644 new mode 100755 diff --git a/octoprint_enclosure/static/js/bootstrap-colorpicker.min.js b/octoprint_enclosure/static/js/bootstrap-colorpicker.min.js old mode 100644 new mode 100755 diff --git a/octoprint_enclosure/static/js/enclosure.js b/octoprint_enclosure/static/js/enclosure.js index fa6fd69..199e4f7 100644 --- a/octoprint_enclosure/static/js/enclosure.js +++ b/octoprint_enclosure/static/js/enclosure.js @@ -112,8 +112,8 @@ $(function () { self.getCleanTemperature = function (temp) { - if (temp === undefined || !_.isNumber(temp)) return "-"; - if (temp < 10) return gettext("off"); + if (temp === undefined || isNaN(parseFloat(temp))) return "-"; + if (temp < 10) return String("off"); return temp; } @@ -168,7 +168,8 @@ $(function () { data: { "enclosureSetTemp": Number($("#enclosureSetTemp").val()) }, success: function (data) { $("#enclosureSetTemp").val(''); - $("#enclosureSetTemp").attr("placeholder", self.getStatusHeater(data.enclosureSetTemperature, data.enclosureCurrentTemperature)); + cleanTemperature = self.getCleanTemperature(data.enclosureSetTemperature); + $("#enclosureSetTemp").attr("placeholder", cleanTemperature); } }); } else { @@ -212,7 +213,7 @@ $(function () { data: { "enclosureSetTemp": 0 }, success: function (data) { $("#enclosureSetTemp").val(''); - $("#enclosureSetTemp").attr("placeholder", self.getStatusHeater(data.enclosureSetTemperature, data.enclosureCurrentTemperature)); + $("#enclosureSetTemp").attr("placeholder", self.getCleanTemperature(data.enclosureSetTemperature)); } }); }; @@ -252,13 +253,6 @@ $(function () { }).responseText; }; - self.getStatusHeater = function (setTemp, currentTemp) { - if (parseFloat(setTemp) > 0.0) { - return self.getCleanTemperature(setTemp); - } - return "off"; - }; - self.handleIO = function (data, event) { $.ajax({ type: "GET", diff --git a/octoprint_enclosure/templates/enclosure_settings.jinja2 b/octoprint_enclosure/templates/enclosure_settings.jinja2 index 6b6bdb5..d9247aa 100644 --- a/octoprint_enclosure/templates/enclosure_settings.jinja2 +++ b/octoprint_enclosure/templates/enclosure_settings.jinja2 @@ -3,11 +3,10 @@
i2cdetect -y 1 on your Raspberry Pi
+ Sensor address in HEX value, you can find it by runing
+ i2cdetect -y 1 on your Raspberry Pi