Skip to content

Commit aac37de

Browse files
authored
0.7.0
### Fixed - GCode off delay.
1 parent 1548f9c commit aac37de

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [0.7.0] - 2018-02-01
8+
### Fixed
9+
- GCode off delay.
10+
711
## [0.6.0] - 2018-01-14
812
### Fixed
913
- Single relay device issues
@@ -51,6 +55,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
5155
### Added
5256
- Initial release.
5357

58+
[0.7.0]: https://github.com/jneilliii/OctoPrint-Tasmota/tree/0.7.0
5459
[0.6.0]: https://github.com/jneilliii/OctoPrint-Tasmota/tree/0.6.0
5560
[0.5.0]: https://github.com/jneilliii/OctoPrint-Tasmota/tree/0.5.0
5661
[0.4.0]: https://github.com/jneilliii/OctoPrint-Tasmota/tree/0.4.0

octoprint_tasmota/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def processGCODE(self, comm_instance, phase, cmd, cmd_type, gcode, *args, **kwar
211211
self._tasmota_logger.debug("Received M80 command, attempting power on of %s index %s." % (plugip,plugidx))
212212
return
213213
elif cmd.startswith("M81"):
214-
t = threading.Timer(int(plug["gcodeOnDelay"]),self.turn_off, [plug["ip"],plug["idx"]],{'username': plug["username"],'password': plug["password"]})
214+
t = threading.Timer(int(plug["gcodeOffDelay"]),self.turn_off, [plug["ip"],plug["idx"]],{'username': plug["username"],'password': plug["password"]})
215215
t.start()
216216
self._tasmota_logger.debug("Received M81 command, attempting power off of %s index %s." % (plugip,plugidx))
217217
return

octoprint_tasmota/static/js/tasmota.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ $(function() {
1313

1414
self.arrSmartplugs = ko.observableArray();
1515
self.isPrinting = ko.observable(false);
16-
16+
self.gcodeOnString = function(data){return 'M80 '+data.ip()+' '+data.idx();};
17+
self.gcodeOffString = function(data){return 'M81 '+data.ip()+' '+data.idx();};
18+
1719
self.onBeforeBinding = function() {
1820
self.arrSmartplugs(self.settings.settings.plugins.tasmota.arrSmartplugs());
1921
}
@@ -80,16 +82,6 @@ $(function() {
8082
console.log('plug data:'+ko.toJSON(plug));
8183
}
8284

83-
if (data.gcodeon && plug.gcodeEnabled) {
84-
setTimeout(function(){self.turnOn(plug)},plug.gcodeOnDelay()*1000);
85-
return false;
86-
}
87-
88-
if (data.gcodeoff && plug.gcodeEnabled) {
89-
setTimeout(function(){self.turnOff(plug)},plug.gcodeOffDelay()*1000);
90-
return false;
91-
}
92-
9385
if (plug.currentState != data.currentState) {
9486
plug.currentState(data.currentState)
9587
switch(data.currentState) {

octoprint_tasmota/templates/tasmota_settings.jinja2

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@
4444
<tr data-bind='visible: gcodeEnabled() && ip().length > 0, attr: {title: ip}'>
4545
<td></td>
4646
<td colspan="2">GCODE On Delay</td>
47-
<td colspan="4"><input type="text" data-bind="value: gcodeOnDelay, uniqueName: true" class="input span12" /></td>
47+
<td colspan="1"><input type="number" min="0" data-bind="value: gcodeOnDelay, uniqueName: true" class="input span12" /></td>
48+
<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>
4849
</tr>
4950
<tr data-bind='visible: gcodeEnabled() && ip().length > 0, attr: {title: ip}'>
5051
<td></td>
5152
<td colspan="2">GCODE Off Delay</td>
52-
<td colspan="4"><input type="text" data-bind="value: gcodeOffDelay, uniqueName: true" class="input span12" /></td>
53+
<td colspan="1"><input type="number" min="0" data-bind="value: gcodeOffDelay, uniqueName: true" class="input span12" /></td>
54+
<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>
5355
</tr>
5456
<tr data-bind='visible: autoConnect() && ip().length > 0, attr: {title: ip}'>
5557
<td></td>

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
plugin_name = "OctoPrint-Tasmota"
1515

1616
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
17-
plugin_version = "0.6.0"
17+
plugin_version = "0.7.0"
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)