Skip to content

Commit

Permalink
0.5.0 (#16)
Browse files Browse the repository at this point in the history
### Notes
- previous settings will be erased during upgrade to accommodate for new features

### Added
- configurable icons using [fontawesome](http://fontawesome.io/3.2.1/cheatsheet/) class names in settings
- title attribute on icons are now configurable via new label setting

### Changed
- default value for index is now blank
- settings screenshot
  • Loading branch information
jneilliii authored Jan 12, 2018
1 parent c83a78e commit 9ad972c
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 6 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This plugin is to control ITead Sonoff devices that have been flashed with [Sono

**Requires minimum Tasmota firmware version 5.9.0.**

[Changelog](changelog.md)

## Screenshots
![screenshot](screenshot.png)

Expand All @@ -27,6 +29,10 @@ Once installed go into settings and enter the ip address for your TP-Link Smartp
- The ip or hostname of tasmota device.
- **Index**
- Index number reprensenting the relay to control. Leave blank for single relay devices.
- **Icon**
- Icon class name from the [fontawesome](http://fontawesome.io/3.2.1/cheatsheet/) library.
- **Label**
- Title attribute on icon that shows on mouseover.
- **Username**
- Username to connect to web interface. Currently not configurable in Tasmota, use the default username admin.
- **Password**
Expand All @@ -47,3 +53,4 @@ Once installed go into settings and enter the ip address for your TP-Link Smartp
- **Cmd Off**
- When checked will run system command configured in **System Command Off** setting after a delay in seconds configured in **System Command Off Delay**.


13 changes: 13 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ 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.5.0] - 2018-01-11
### Notes
- previous settings will be erased during upgrade to accommodate for new features

### Added
- configurable icons using [fontawesome](http://fontawesome.io/3.2.1/cheatsheet/) class names in settings
- title attribute on icons are now configurable via new label setting

### Changed
- default value for index is now blank
- settings screenshot

## [0.4.0] - 2018-01-10
### Notes
- requires minimum Tasmota firmware version 5.9.0.
Expand All @@ -28,6 +40,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
- Initial release.

[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
[0.3.0]: https://github.com/jneilliii/OctoPrint-Tasmota/tree/0.3.0
[0.2.0]: https://github.com/jneilliii/OctoPrint-Tasmota/tree/0.2.0
Expand Down
4 changes: 2 additions & 2 deletions octoprint_tasmota/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def on_after_startup(self):
def get_settings_defaults(self):
return dict(
debug_logging = False,
arrSmartplugs = [{'ip':'','displayWarning':True,'idx':1,'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','username':'admin','password':''}],
arrSmartplugs = [{'ip':'','displayWarning':True,'idx':'','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','username':'admin','password':'','icon':'icon-bolt','label':''}],
)

def on_settings_save(self, data):
Expand All @@ -58,7 +58,7 @@ def on_settings_save(self, data):
self._tasmota_logger.setLevel(logging.INFO)

def get_settings_version(self):
return 2
return 3

def on_settings_migrate(self, target, current=None):
if current is None or current < self.get_settings_version():
Expand Down
6 changes: 4 additions & 2 deletions octoprint_tasmota/static/js/tasmota.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $(function() {

self.addPlug = function() {
self.settings.settings.plugins.tasmota.arrSmartplugs.push({'ip':ko.observable(''),
'idx':ko.observable(1),
'idx':ko.observable(''),
'displayWarning':ko.observable(true),
'warnPrinting':ko.observable(false),
'gcodeEnabled':ko.observable(false),
Expand All @@ -56,7 +56,9 @@ $(function() {
'currentState':ko.observable('unknown'),
'btnColor':ko.observable('#808080'),
'username':ko.observable('admin'),
'password':ko.observable('')});
'password':ko.observable(''),
'icon':ko.observable('icon-bolt'),
'label':ko.observable('')});
}

self.removePlug = function(row) {
Expand Down
2 changes: 1 addition & 1 deletion octoprint_tasmota/templates/tasmota_navbar.jinja2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- ko foreach: settings.settings.plugins.tasmota.arrSmartplugs -->
<!-- ko if: $data.ip().length > 0 -->
<a class="pull-right" href=#" data-bind="click: $root.toggleRelay,visible: $root.loginState.loggedIn(),style: {color: $data.btnColor()}, attr: {title: $data.ip() + '|' + $data.idx()}" style="display: none;float: left;"><i class="icon-bolt"></i></a>
<a class="pull-right" href=#" data-bind="click: $root.toggleRelay,visible: $root.loginState.loggedIn(),style: {color: $data.btnColor()}, attr: {title: $data.label()}" style="display: none;float: left;"><i class="icon" data-bind="css: $data.icon()"></i></a>
<div data-bind="attr: {id: 'tasmota_poweroff_confirmation_dialog_' + $data.ip() + '_' + $data.idx()}" class="modal hide fade">
<div class="modal-header">
<a href="#" class="close" data-dismiss="modal" aria-hidden="true">&times;</a>
Expand Down
7 changes: 7 additions & 0 deletions octoprint_tasmota/templates/tasmota_settings.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
<td colspan="2"><input type="text" data-bind='value: idx, uniqueName: true' class="input span12" /></td>
<td style="text-align:center"><a href="#" class="icon-trash" data-bind="click: $root.removePlug, visible: $root.settings.settings.plugins.tasmota.arrSmartplugs().length > 1"></a></td>
</tr>
<tr data-bind='visible: ip().length > 0, attr: {title: ip}' class="info">
<td><strong><i class="icon" data-bind="css: icon"></i> <a href="http://fontawesome.io/3.2.1/cheatsheet/" target="_blank" title="Use fontawesome class name">Icon</a></strong></td>
<td colspan="2"><input type="text" data-bind='value: icon, uniqueName: true' class="input span12" /></td>
<td><strong>Label</strong></td>
<td colspan="2"><input type="text" data-bind='value: label, uniqueName: true' class="input span12" /></td>
<td style="text-align:center"><a href="#" class="icon-trash" data-bind="click: $root.removePlug, visible: $root.settings.settings.plugins.tasmota.arrSmartplugs().length > 1"></a></td>
</tr>
<tr data-bind='visible: ip().length > 0, attr: {title: ip}' class="info">
<td><strong>Username</strong></td>
<td colspan="2"><input type="text" data-bind='value: username, uniqueName: true' class="input span12" placeholder="admin" /></td>
Expand Down
Binary file modified settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.4.0"
plugin_version = "0.5.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 9ad972c

Please sign in to comment.