From 9ad972c82e533d83ada72bd6b33841bd10a9bec1 Mon Sep 17 00:00:00 2001 From: jneilliii Date: Thu, 11 Jan 2018 21:46:07 -0500 Subject: [PATCH] 0.5.0 (#16) ### 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 --- README.md | 7 +++++++ changelog.md | 13 +++++++++++++ octoprint_tasmota/__init__.py | 4 ++-- octoprint_tasmota/static/js/tasmota.js | 6 ++++-- .../templates/tasmota_navbar.jinja2 | 2 +- .../templates/tasmota_settings.jinja2 | 7 +++++++ settings.png | Bin 32214 -> 31611 bytes setup.py | 2 +- 8 files changed, 35 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5bab95e..099d60a 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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** @@ -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**. + diff --git a/changelog.md b/changelog.md index 5acaba7..256debd 100644 --- a/changelog.md +++ b/changelog.md @@ -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. @@ -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 diff --git a/octoprint_tasmota/__init__.py b/octoprint_tasmota/__init__.py index efeac03..51994fe 100644 --- a/octoprint_tasmota/__init__.py +++ b/octoprint_tasmota/__init__.py @@ -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): @@ -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(): diff --git a/octoprint_tasmota/static/js/tasmota.js b/octoprint_tasmota/static/js/tasmota.js index c4d3ddb..d329d06 100644 --- a/octoprint_tasmota/static/js/tasmota.js +++ b/octoprint_tasmota/static/js/tasmota.js @@ -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), @@ -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) { diff --git a/octoprint_tasmota/templates/tasmota_navbar.jinja2 b/octoprint_tasmota/templates/tasmota_navbar.jinja2 index f072479..fbfc4d6 100644 --- a/octoprint_tasmota/templates/tasmota_navbar.jinja2 +++ b/octoprint_tasmota/templates/tasmota_navbar.jinja2 @@ -1,6 +1,6 @@ - +