Skip to content

Commit 769296b

Browse files
authored
0.8.0
### Added - Status polling of all configured plugs. After enabling, you must restart the browser once to start the polling loop.
1 parent a644adb commit 769296b

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
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.8.0] - 2018-01-29
8+
### Added
9+
- Status polling of all configured plugs.
10+
711
## [0.7.3] - 2017-12-21
812
### Changed
913
- Moved all command processing to server side to resolve gcode processing issues when web front-end wasn't loaded.
@@ -88,6 +92,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
8892
### Added
8993
- Initial release.
9094

95+
[0.8.0]: https://github.com/jneilliii/OctoPrint-TPLinkSmartplug/tree/0.8.0
9196
[0.7.3]: https://github.com/jneilliii/OctoPrint-TPLinkSmartplug/tree/0.7.3
9297
[0.7.2]: https://github.com/jneilliii/OctoPrint-TPLinkSmartplug/tree/0.7.2
9398
[0.7.1]: https://github.com/jneilliii/OctoPrint-TPLinkSmartplug/tree/0.7.1

octoprint_tplinksmartplug/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def get_settings_defaults(self):
4343
return dict(
4444
debug_logging = False,
4545
arrSmartplugs = [{'ip':'','displayWarning':True,'warnPrinting':False,'gcodeEnabled':False,'gcodeOnDelay':0,'gcodeOffDelay':0,'autoConnect':True,'autoConnectDelay':10.0,'autoDisconnect':True,'autoDisconnectDelay':0,'sysCmdOn':False,'sysRunCmdOn':'','sysCmdOnDelay':0,'sysCmdOff':False,'sysRunCmdOff':'','sysCmdOffDelay':0,'currentState':'unknown','btnColor':'#808080'}],
46+
pollingInterval = 15,
47+
pollingEnabled = False
4648
)
4749

4850
def on_settings_save(self, data):

octoprint_tplinksmartplug/static/js/tplinksmartplug.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ $(function() {
209209
self.checkStatus(item.ip());
210210
}
211211
});
212+
if (self.settings.settings.plugins.tplinksmartplug.pollingEnabled()) {
213+
setTimeout(function() {self.checkStatuses();}, (parseInt(self.settings.settings.plugins.tplinksmartplug.pollingInterval(),10) * 60000));
214+
};
212215
};
213216
}
214217

octoprint_tplinksmartplug/templates/tplinksmartplug_settings.jinja2

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,17 @@
7474
</label>
7575
</div>
7676
</div>
77+
<div class="control-group">
78+
<div class="controls">
79+
<label class="checkbox">
80+
<input type="checkbox" data-bind="checked: settings.settings.plugins.tplinksmartplug.pollingEnabled" /> Enable polling of status.
81+
</label>
82+
</div>
83+
</div>
84+
<div class="control-group" data-bind="visible: settings.settings.plugins.tplinksmartplug.pollingEnabled">
85+
<div class="controls">
86+
<label class="control-label">{{ _('Minutes between checks') }}</label>
87+
<input type="number" min="0" data-bind="value: settings.settings.plugins.tplinksmartplug.pollingInterval" />
88+
</div>
89+
</div>
7790
</div>

setup.py

Lines changed: 1 addition & 1 deletion
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 = "0.7.3"
17+
plugin_version = "0.8.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)