Skip to content

Commit

Permalink
0.8.12 (#71)
Browse files Browse the repository at this point in the history
* fix wording of Automatic Power Off within the plug editor
* set minimum polling interval to 1
* don't try to poll unless polling interval is greater than 0
  • Loading branch information
jneilliii authored May 3, 2020
1 parent 09a2327 commit 05954c5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ daysUntilClose: 7
exemptLabels:
- enhancement
- bug
- solved
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
Expand Down
12 changes: 6 additions & 6 deletions octoprint_tasmota/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def on_startup(self, host, port):

def on_after_startup(self):
self._logger.info("Tasmota loaded!")
if self._settings.get(["polling_enabled"]):
self.poll_status = RepeatedTimer(int(self._settings.get(["polling_interval"]))*60, self.check_statuses)
if self._settings.get_boolean(["polling_enabled"]) and self._settings.get_int(["polling_interval"]) > 0:
self.poll_status = RepeatedTimer(int(self._settings.get_int(["polling_interval"]))*60, self.check_statuses)
self.poll_status.start()

##~~ SettingsPlugin mixin
Expand All @@ -83,7 +83,7 @@ def get_settings_defaults(self):
return dict(
debug_logging = False,
polling_enabled = False,
polling_interval = 0,
polling_interval = 5,
thermal_runaway_monitoring = False,
thermal_runaway_max_bed = 120,
thermal_runaway_max_extruder = 300,
Expand All @@ -95,7 +95,7 @@ def get_settings_defaults(self):
def on_settings_save(self, data):
old_debug_logging = self._settings.get_boolean(["debug_logging"])
old_polling_value = self._settings.get_boolean(["polling_enabled"])
old_polling_timer = self._settings.get(["polling_interval"])
old_polling_timer = self._settings.get_int(["polling_interval"])
old_automatic_power_off = self._settings.get_boolean(["automatic_power_off"])

octoprint.plugin.SettingsPlugin.on_settings_save(self, data)
Expand All @@ -108,7 +108,7 @@ def on_settings_save(self, data):

new_debug_logging = self._settings.get_boolean(["debug_logging"])
new_polling_value = self._settings.get_boolean(["polling_enabled"])
new_polling_timer = self._settings.get(["polling_interval"])
new_polling_timer = self._settings.get_int(["polling_interval"])

if old_debug_logging != new_debug_logging:
if new_debug_logging:
Expand All @@ -120,7 +120,7 @@ def on_settings_save(self, data):
if self.poll_status:
self.poll_status.cancel()

if new_polling_value:
if new_polling_value and new_polling_timer > 0:
self.poll_status = RepeatedTimer(int(self._settings.get(["polling_interval"]))*60, self.check_statuses)
self.poll_status.start()

Expand Down
4 changes: 2 additions & 2 deletions octoprint_tasmota/templates/tasmota_settings.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<div class="control-group" data-bind="visible: settings.settings.plugins.tasmota.polling_enabled">
<div class="controls">
<label class="control-label">{{ _('Minutes between checks') }}</label>
<input type="number" min="0" class="input input-small" data-bind="value: settings.settings.plugins.tasmota.polling_interval" />
<input type="number" min="1" class="input input-small" data-bind="value: settings.settings.plugins.tasmota.polling_interval" />
</div>
</div>

Expand Down Expand Up @@ -126,7 +126,7 @@
<span class="add-on" data-bind="visible: autoDisconnect">secs</span>
</div>
</td>
<td><div class="controls"><label class="checkbox"><input type="checkbox" data-bind="checked: automaticShutdownEnabled" title="Automatically power off on print completion." /> Print Complete Off</label></div></td>
<td><div class="controls"><label class="checkbox"><input type="checkbox" data-bind="checked: automaticShutdownEnabled" title="Automatically power off when printer is idle." /> Automatic Power Off</label></div></td>
<td><div class="controls"><label class="checkbox"><input type="checkbox" data-bind="checked: displayWarning" title="Prompt for confirmation before powering off via the navbar button." /> Warning Prompt</label></div></td>
<td><div class="controls"><label class="checkbox"><input type="checkbox" data-bind="checked: warnPrinting" title="Prompt for confimration before powering off when a print is active." /> Warn While Printing</label></div></td>
<td><div class="controls"><label class="checkbox"><input type="checkbox" data-bind="checked: thermal_runaway" title="Power off if temperature exceeds configured max temperatures." /> Thermal Runaway</label></div></td>
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 = "0.8.11"
plugin_version = "0.8.12"

# 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 05954c5

Please sign in to comment.