Skip to content

Commit

Permalink
add heaters to ignore for idle timeout processing, #202
Browse files Browse the repository at this point in the history
  • Loading branch information
jneilliii committed Aug 9, 2023
1 parent da51605 commit d83433f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 5 additions & 3 deletions octoprint_tasmota/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def get_settings_defaults(self):
"powerOffWhenIdle": False,
"idleTimeout": 30,
"idleIgnoreCommands": 'M105',
"idleIgnoreHeaters": '',
"idleTimeoutWaitTemp": 50,
"idleWaitForTimelapse": True,
"event_on_upload_monitoring": False,
Expand Down Expand Up @@ -980,11 +981,12 @@ def _wait_for_timelapse(self):
def _wait_for_heaters(self):
self._waitForHeaters = True
heaters = self._printer.get_current_temperatures()
ignored_heaters = self._settings.get(["idleIgnoreHeaters"]).split(',')

for heater, entry in heaters.items():
target = entry.get("target")
if target is None:
# heater doesn't exist in fw
if target is None or heater in ignored_heaters:
# heater doesn't exist in fw or set to be ignored
continue

try:
Expand All @@ -1010,7 +1012,7 @@ def _wait_for_heaters(self):
highest_temp = 0
heaters_above_waittemp = []
for heater, entry in heaters.items():
if not heater.startswith("tool"):
if not heater.startswith("tool") or heater in ignored_heaters:
continue

actual = entry.get("actual")
Expand Down
8 changes: 8 additions & 0 deletions octoprint_tasmota/templates/tasmota_settings.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@
</div>
</div>
</div>
<div class="row-fluid" data-bind="visible: settings.settings.plugins.tasmota.powerOffWhenIdle()">
<div class="control-group">
<label class="control-label">{{ _('Heaters to Ignore for Idle') }}</label>
<div class="controls" data-toggle="tooltip" data-bind="tooltip: {}" title="{{ _('Comma separated list of heaters to ignore for idle temperature. ie, for Prusa MK4 include X.') }}">
<input type="text" class="input-block-level" data-bind="value: settings.settings.plugins.tasmota.idleIgnoreHeaters, enable: settings.settings.plugins.tasmota.powerOffWhenIdle()" disabled />
</div>
</div>
</div>
<div class="row-fluid" data-bind="visible: settings.settings.plugins.tasmota.powerOffWhenIdle()">
<div class="control-group">
<div class="controls">
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugin_name = "OctoPrint-Tasmota"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "1.1.4rc1"
plugin_version = "1.1.4rc2"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down

0 comments on commit d83433f

Please sign in to comment.