Skip to content

Commit c83a78e

Browse files
authored
0.4.0 (#14)
### Notes - requires minimum Tasmota firmware version 5.9.0. ### Fixed - status detection related to newer Tasmota software response being different
1 parent 908b6ea commit c83a78e

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

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

5+
**Requires minimum Tasmota firmware version 5.9.0.**
6+
57
## Screenshots
68
![screenshot](screenshot.png)
79

@@ -24,7 +26,7 @@ Once installed go into settings and enter the ip address for your TP-Link Smartp
2426
- **Device**
2527
- The ip or hostname of tasmota device.
2628
- **Index**
27-
- Index number reprensenting the relay to control. If using a simple single relay device leave this value blank.
29+
- Index number reprensenting the relay to control. Leave blank for single relay devices.
2830
- **Username**
2931
- Username to connect to web interface. Currently not configurable in Tasmota, use the default username admin.
3032
- **Password**

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ 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.4.0] - 2018-01-10
8+
### Notes
9+
- requires minimum Tasmota firmware version 5.9.0.
10+
11+
### Fixed
12+
- status detection related to newer Tasmota software response being different
13+
714
## [0.3.0] - 2018-01-04
815
### Fixed
916
- multiple relays not being detected properly
@@ -21,6 +28,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2128
### Added
2229
- Initial release.
2330

31+
[0.4.0]: https://github.com/jneilliii/OctoPrint-Tasmota/tree/0.4.0
2432
[0.3.0]: https://github.com/jneilliii/OctoPrint-Tasmota/tree/0.3.0
2533
[0.2.0]: https://github.com/jneilliii/OctoPrint-Tasmota/tree/0.2.0
2634
[0.1.0]: https://github.com/jneilliii/OctoPrint-Tasmota/tree/0.1.0

octoprint_tasmota/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def turn_on(self, plugip, plugidx, username="admin", password=""):
8787
self._tasmota_logger.debug("Turning on %s index %s." % (plugip, plugidx))
8888
try:
8989
webresponse = urllib2.urlopen("http://" + plugip + "/cm?user=" + username + "&password=" + password + "&cmnd=Power" + str(plugidx) + "%20on").read()
90-
response = json.loads(webresponse.split()[2])
90+
response = json.loads(webresponse)
9191
chk = response["POWER%s" % plugidx]
9292
except:
9393
self._tasmota_logger.error('Invalid ip or unknown error connecting to %s.' % plugip, exc_info=True)
@@ -108,7 +108,7 @@ def turn_off(self, plugip, plugidx, username="admin", password=""):
108108
self._tasmota_logger.debug("Turning off %s index %s." % (plugip, plugidx))
109109
try:
110110
webresponse = urllib2.urlopen("http://" + plugip + "/cm?user=" + username + "&password=" + password + "&cmnd=Power" + str(plugidx) + "%20off").read()
111-
response = json.loads(webresponse.split()[2])
111+
response = json.loads(webresponse)
112112
chk = response["POWER%s" % plugidx]
113113
except:
114114
self._tasmota_logger.error('Invalid ip or unknown error connecting to %s.' % plugip, exc_info=True)
@@ -131,7 +131,7 @@ def check_status(self, plugip, plugidx, username="admin", password=""):
131131
try:
132132
webresponse = urllib2.urlopen("http://" + plugip + "/cm?user=" + username + "&password=" + password + "&cmnd=Power" + str(plugidx)).read()
133133
self._tasmota_logger.debug("%s index %s response: %s" % (plugip, plugidx, webresponse))
134-
response = json.loads(webresponse.split()[2])
134+
response = json.loads(webresponse)
135135
chk = response["POWER%s" % plugidx]
136136
except:
137137
self._tasmota_logger.error('Invalid ip or unknown error connecting to %s.' % plugip, exc_info=True)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
plugin_name = "OctoPrint-Tasmota"
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.3.0"
17+
plugin_version = "0.4.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)