Skip to content

Commit

Permalink
0.7.0
Browse files Browse the repository at this point in the history
### Fixed
- GCode off delay.
  • Loading branch information
jneilliii authored Feb 2, 2018
1 parent 1548f9c commit aac37de
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.7.0] - 2018-02-01
### Fixed
- GCode off delay.

## [0.6.0] - 2018-01-14
### Fixed
- Single relay device issues
Expand Down Expand Up @@ -51,6 +55,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
- Initial release.

[0.7.0]: https://github.com/jneilliii/OctoPrint-Tasmota/tree/0.7.0
[0.6.0]: https://github.com/jneilliii/OctoPrint-Tasmota/tree/0.6.0
[0.5.0]: https://github.com/jneilliii/OctoPrint-Tasmota/tree/0.5.0
[0.4.0]: https://github.com/jneilliii/OctoPrint-Tasmota/tree/0.4.0
Expand Down
2 changes: 1 addition & 1 deletion octoprint_tasmota/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def processGCODE(self, comm_instance, phase, cmd, cmd_type, gcode, *args, **kwar
self._tasmota_logger.debug("Received M80 command, attempting power on of %s index %s." % (plugip,plugidx))
return
elif cmd.startswith("M81"):
t = threading.Timer(int(plug["gcodeOnDelay"]),self.turn_off, [plug["ip"],plug["idx"]],{'username': plug["username"],'password': plug["password"]})
t = threading.Timer(int(plug["gcodeOffDelay"]),self.turn_off, [plug["ip"],plug["idx"]],{'username': plug["username"],'password': plug["password"]})
t.start()
self._tasmota_logger.debug("Received M81 command, attempting power off of %s index %s." % (plugip,plugidx))
return
Expand Down
14 changes: 3 additions & 11 deletions octoprint_tasmota/static/js/tasmota.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ $(function() {

self.arrSmartplugs = ko.observableArray();
self.isPrinting = ko.observable(false);

self.gcodeOnString = function(data){return 'M80 '+data.ip()+' '+data.idx();};
self.gcodeOffString = function(data){return 'M81 '+data.ip()+' '+data.idx();};

self.onBeforeBinding = function() {
self.arrSmartplugs(self.settings.settings.plugins.tasmota.arrSmartplugs());
}
Expand Down Expand Up @@ -80,16 +82,6 @@ $(function() {
console.log('plug data:'+ko.toJSON(plug));
}

if (data.gcodeon && plug.gcodeEnabled) {
setTimeout(function(){self.turnOn(plug)},plug.gcodeOnDelay()*1000);
return false;
}

if (data.gcodeoff && plug.gcodeEnabled) {
setTimeout(function(){self.turnOff(plug)},plug.gcodeOffDelay()*1000);
return false;
}

if (plug.currentState != data.currentState) {
plug.currentState(data.currentState)
switch(data.currentState) {
Expand Down
6 changes: 4 additions & 2 deletions octoprint_tasmota/templates/tasmota_settings.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@
<tr data-bind='visible: gcodeEnabled() && ip().length > 0, attr: {title: ip}'>
<td></td>
<td colspan="2">GCODE On Delay</td>
<td colspan="4"><input type="text" data-bind="value: gcodeOnDelay, uniqueName: true" class="input span12" /></td>
<td colspan="1"><input type="number" min="0" data-bind="value: gcodeOnDelay, uniqueName: true" class="input span12" /></td>
<td colspan="3" style="text-align: center; vertical-align: middle;">Use: <span class="label" title="Use this gcode command to power on relay." data-bind="text: $root.gcodeOnString($data);"></span></td>
</tr>
<tr data-bind='visible: gcodeEnabled() && ip().length > 0, attr: {title: ip}'>
<td></td>
<td colspan="2">GCODE Off Delay</td>
<td colspan="4"><input type="text" data-bind="value: gcodeOffDelay, uniqueName: true" class="input span12" /></td>
<td colspan="1"><input type="number" min="0" data-bind="value: gcodeOffDelay, uniqueName: true" class="input span12" /></td>
<td colspan="3" style="text-align: center; vertical-align: middle;">Use: <span class="label" title="Use this gcode command to power off relay." data-bind="text: $root.gcodeOffString($data);"></span></td>
</tr>
<tr data-bind='visible: autoConnect() && ip().length > 0, attr: {title: ip}'>
<td></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.6.0"
plugin_version = "0.7.0"

# 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 aac37de

Please sign in to comment.