Skip to content

Commit

Permalink
add send_plugin_message back to check status. concerned of multiple c…
Browse files Browse the repository at this point in the history
…alls, might need to remove these from turn_on and turn_off.
  • Loading branch information
jneilliii committed Dec 19, 2020
1 parent 95648d7 commit c896d24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions octoprint_tasmota/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,12 +455,15 @@ def check_status(self, plugip, plugidx):

self._tasmota_logger.debug("%s index %s is %s" % (plugip, plugidx, chk))
if chk.upper() == "ON":
return {"currentState": "on", "ip": plugip, "idx": plugidx, "energy_data": energy_data, "sensor_data": sensor_data}
response = {"currentState": "on", "ip": plugip, "idx": plugidx, "energy_data": energy_data, "sensor_data": sensor_data}
elif chk.upper() == "OFF":
return {"currentState": "off", "ip": plugip, "idx": plugidx, "energy_data": energy_data, "sensor_data": sensor_data}
response = {"currentState": "off", "ip": plugip, "idx": plugidx, "energy_data": energy_data, "sensor_data": sensor_data}
else:
self._tasmota_logger.debug(response)
return {"currentState": "unknown", "ip": plugip, "idx": plugidx, "energy_data": energy_data, "sensor_data": sensor_data}
response = {"currentState": "unknown", "ip": plugip, "idx": plugidx, "energy_data": energy_data, "sensor_data": sensor_data}

self._plugin_manager.send_plugin_message(self._identifier, response)
return response

def checkSetOption26(self, plugip, username, password):
webresponse = requests.get("http://" + plugip + "/cm?user=" + username + "&password=" + requests.utils.quote(
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.8.17rc1"
plugin_version = "0.8.17rc2"

# 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 c896d24

Please sign in to comment.