Skip to content

Commit c96ca0c

Browse files
committed
add ignored heaters setting for idle timer, workaround for Prusa MK4, #336
1 parent 501267a commit c96ca0c

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

octoprint_tplinksmartplug/__init__.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def get_settings_defaults(self):
169169
'event_on_upload_monitoring': False, 'event_on_upload_monitoring_always': False,
170170
'event_on_startup_monitoring': False, 'event_on_shutdown_monitoring': False, 'cost_rate': 0,
171171
'abortTimeout': 30, 'powerOffWhenIdle': False, 'idleTimeout': 30, 'idleIgnoreCommands': 'M105',
172-
'idleTimeoutWaitTemp': 50, 'progress_polling': False, 'useDropDown': False}
172+
'idleIgnoreHeaters': '', 'idleTimeoutWaitTemp': 50, 'progress_polling': False, 'useDropDown': False}
173173

174174
def on_settings_save(self, data):
175175
old_debug_logging = self._settings.get_boolean(["debug_logging"])
@@ -850,11 +850,12 @@ def _wait_for_timelapse(self):
850850
def _wait_for_heaters(self):
851851
self._waitForHeaters = True
852852
heaters = self._printer.get_current_temperatures()
853+
ignored_heaters = self._settings.get(["idleIgnoreHeaters"]).split(',')
853854

854855
for heater, entry in heaters.items():
855856
target = entry.get("target")
856-
if target is None:
857-
# heater doesn't exist in fw
857+
if target is None or heater in ignored_heaters:
858+
# heater doesn't exist in fw or set to be ignored
858859
continue
859860

860861
try:
@@ -880,7 +881,7 @@ def _wait_for_heaters(self):
880881
highest_temp = 0
881882
heaters_above_waittemp = []
882883
for heater, entry in heaters.items():
883-
if not heater.startswith("tool"):
884+
if not heater.startswith("tool") or heater in ignored_heaters:
884885
continue
885886

886887
actual = entry.get("actual")

octoprint_tplinksmartplug/templates/tplinksmartplug_settings.jinja2

+8
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,14 @@
183183
</div>
184184
</div>
185185
</div>
186+
<div class="row-fluid">
187+
<div class="control-group">
188+
<label class="control-label">{{ _('Heaters to Ignore for Idle') }}</label>
189+
<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.') }}">
190+
<input type="text" class="input-block-level" data-bind="value: settings.settings.plugins.tplinksmartplug.idleIgnoreHeaters, enable: settings.settings.plugins.tplinksmartplug.powerOffWhenIdle() && settings.settings.plugins.tplinksmartplug.powerOffWhenIdle()" disabled />
191+
</div>
192+
</div>
193+
</div>
186194
<div class="row-fluid">
187195
<div class="control-group">
188196
<label class="control-label">{{ _('GCode Commands to Ignore for Idle') }}</label>

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
plugin_name = "OctoPrint-TPLinkSmartplug"
1515

1616
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
17-
plugin_version = "1.0.4rc1"
17+
plugin_version = "1.0.4rc2"
1818

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

0 commit comments

Comments
 (0)