Skip to content

Commit

Permalink
0.4.0 (#14)
Browse files Browse the repository at this point in the history
### Notes
- requires minimum Tasmota firmware version 5.9.0.

### Fixed
- status detection related to newer Tasmota software response being different
  • Loading branch information
jneilliii authored Jan 10, 2018
1 parent 908b6ea commit c83a78e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This plugin is to control ITead Sonoff devices that have been flashed with [Sonoff-Tasmota](https://github.com/arendst/Sonoff-Tasmota) via web calls.

**Requires minimum Tasmota firmware version 5.9.0.**

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

Expand All @@ -24,7 +26,7 @@ Once installed go into settings and enter the ip address for your TP-Link Smartp
- **Device**
- The ip or hostname of tasmota device.
- **Index**
- Index number reprensenting the relay to control. If using a simple single relay device leave this value blank.
- Index number reprensenting the relay to control. Leave blank for single relay devices.
- **Username**
- Username to connect to web interface. Currently not configurable in Tasmota, use the default username admin.
- **Password**
Expand Down
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ 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.4.0] - 2018-01-10
### Notes
- requires minimum Tasmota firmware version 5.9.0.

### Fixed
- status detection related to newer Tasmota software response being different

## [0.3.0] - 2018-01-04
### Fixed
- multiple relays not being detected properly
Expand All @@ -21,6 +28,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
- Initial release.

[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
[0.1.0]: https://github.com/jneilliii/OctoPrint-Tasmota/tree/0.1.0
6 changes: 3 additions & 3 deletions octoprint_tasmota/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def turn_on(self, plugip, plugidx, username="admin", password=""):
self._tasmota_logger.debug("Turning on %s index %s." % (plugip, plugidx))
try:
webresponse = urllib2.urlopen("http://" + plugip + "/cm?user=" + username + "&password=" + password + "&cmnd=Power" + str(plugidx) + "%20on").read()
response = json.loads(webresponse.split()[2])
response = json.loads(webresponse)
chk = response["POWER%s" % plugidx]
except:
self._tasmota_logger.error('Invalid ip or unknown error connecting to %s.' % plugip, exc_info=True)
Expand All @@ -108,7 +108,7 @@ def turn_off(self, plugip, plugidx, username="admin", password=""):
self._tasmota_logger.debug("Turning off %s index %s." % (plugip, plugidx))
try:
webresponse = urllib2.urlopen("http://" + plugip + "/cm?user=" + username + "&password=" + password + "&cmnd=Power" + str(plugidx) + "%20off").read()
response = json.loads(webresponse.split()[2])
response = json.loads(webresponse)
chk = response["POWER%s" % plugidx]
except:
self._tasmota_logger.error('Invalid ip or unknown error connecting to %s.' % plugip, exc_info=True)
Expand All @@ -131,7 +131,7 @@ def check_status(self, plugip, plugidx, username="admin", password=""):
try:
webresponse = urllib2.urlopen("http://" + plugip + "/cm?user=" + username + "&password=" + password + "&cmnd=Power" + str(plugidx)).read()
self._tasmota_logger.debug("%s index %s response: %s" % (plugip, plugidx, webresponse))
response = json.loads(webresponse.split()[2])
response = json.loads(webresponse)
chk = response["POWER%s" % plugidx]
except:
self._tasmota_logger.error('Invalid ip or unknown error connecting to %s.' % plugip, exc_info=True)
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-Tasmota"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "0.3.0"
plugin_version = "0.4.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 c83a78e

Please sign in to comment.