Skip to content

Commit

Permalink
0.9.12
Browse files Browse the repository at this point in the history
  • Loading branch information
jneilliii authored Feb 11, 2019
1 parent bbb1df3 commit 86d657c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
9 changes: 7 additions & 2 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.9.12] - 2019-02-10
### Fixed
- Issue introduced in previous version prevented fresh installs from working properly.

## [0.9.11] - 2019-02-09
### Fixed
- Energy monitoring sidebar not displaying consistently.
Expand Down Expand Up @@ -158,8 +162,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
- Initial release.

[0.9.9]: https://github.com/jneilliii/OctoPrint-TPLinkSmartplug/tree/0.9.11
[0.9.9]: https://github.com/jneilliii/OctoPrint-TPLinkSmartplug/tree/0.9.10
[0.9.12]: https://github.com/jneilliii/OctoPrint-TPLinkSmartplug/tree/0.9.12
[0.9.11]: https://github.com/jneilliii/OctoPrint-TPLinkSmartplug/tree/0.9.11
[0.9.10]: https://github.com/jneilliii/OctoPrint-TPLinkSmartplug/tree/0.9.10
[0.9.9]: https://github.com/jneilliii/OctoPrint-TPLinkSmartplug/tree/0.9.9
[0.9.8]: https://github.com/jneilliii/OctoPrint-TPLinkSmartplug/tree/0.9.8
[0.9.7]: https://github.com/jneilliii/OctoPrint-TPLinkSmartplug/tree/0.9.7
Expand Down
19 changes: 11 additions & 8 deletions octoprint_tplinksmartplug/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from datetime import datetime

class tplinksmartplugPlugin(octoprint.plugin.SettingsPlugin,
octoprint.plugin.AssetPlugin,
octoprint.plugin.TemplatePlugin,
octoprint.plugin.AssetPlugin,
octoprint.plugin.TemplatePlugin,
octoprint.plugin.SimpleApiPlugin,
octoprint.plugin.StartupPlugin,
octoprint.plugin.ProgressPlugin):
Expand Down Expand Up @@ -45,7 +45,7 @@ def on_after_startup(self):
def get_settings_defaults(self):
return dict(
debug_logging = False,
arrSmartplugs = [{'ip':'','label':'','icon':'icon-bolt','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','useCountdownRules':False,'countdownOnDelay':0,'countdownOffDelay':0,'emeter':None}],
arrSmartplugs = [{'ip':'','label':'','icon':'icon-bolt','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','useCountdownRules':False,'countdownOnDelay':0,'countdownOffDelay':0,'emeter':{'get_realtime':{}}}],
pollingInterval = 15,
pollingEnabled = False
)
Expand Down Expand Up @@ -168,15 +168,18 @@ def turn_off(self, plugip):
def check_status(self, plugip):
self._tplinksmartplug_logger.debug("Checking status of %s." % plugip)
if plugip != "":
emeter_data = None
today = datetime.today()
check_status_cmnd = '{"system":{"get_sysinfo":{}},"emeter":{"get_realtime":{}}}'
check_status_cmnd = '{"system":{"get_sysinfo":{}}}'
# ,"get_daystat":{"month":%d,"year":%d}}}' % (today.month, today.year)
# ,"emeter":{"get_realtime":{}}
self._tplinksmartplug_logger.debug(check_status_cmnd)
response = self.sendCommand(check_status_cmnd, plugip)
if self.lookup(response, *["emeter","get_realtime"]):
emeter_data = response["emeter"]
else:
emeter_data = None

if "ENE" in self.lookup(response, *["system","get_sysinfo","feature"]):
check_emeter_data = self.sendCommand('{"emeter":{"get_realtime":{}}}', plugip)
if self.lookup(check_emeter_data, *["emeter","get_realtime"]):
emeter_data = check_emeter_data["emeter"]

chk = self.lookup(response,*["system","get_sysinfo","relay_state"])
if chk == 1:
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-TPLinkSmartplug"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "0.9.11"
plugin_version = "0.9.12"

# 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 86d657c

Please sign in to comment.