OctoPrint-TuyaSmartplug icon indicating copy to clipboard operation
OctoPrint-TuyaSmartplug copied to clipboard

Cannot toggle plug with new install of Octoprint under Python 3.10

Open shaddow501 opened this issue 2 years ago • 1 comments

Hello, this is the error I get, where do I go from there?

octoprint_tuyasmartplug.utils.pytuya - ERROR - Unexpected status() payload=b'\xcd\x1cI\x1dA6O\xc8\xbb\x19\xbc_\xc2A\xbbCK\x85QHg\x8d\x84u,,X\xbe\xd3E\xb6' octoprint_tuyasmartplug.utils.pytuya - ERROR - Unexpected status() payload=b'\xcd\x1cI\x1dA6O\xc8\xbb\x19\xbc_\xc2A\xbbCK\x85QHg\x8d\x84u,,X\xbe\xd3E\xb6' octoprint.server.api - ERROR - Error while executing SimpleApiPlugin tuyasmartplug Traceback (most recent call last): File "/home/printer/OctoPrint/venv/lib/python3.10/site-packages/octoprint/server/api/init.py", line 154, in pluginCommand response = api_plugin.on_api_command(command, data) File "/home/printer/OctoPrint/venv/lib/python3.10/site-packages/octoprint/util/init.py", line 1688, in wrapper return f(*args, **kwargs) File "/home/printer/OctoPrint/venv/lib/python3.10/site-packages/octoprint_tuyasmartplug/init.py", line 258, in on_api_command self.check_status("{label}".format(**data)) File "/home/printer/OctoPrint/venv/lib/python3.10/site-packages/octoprint_tuyasmartplug/init.py", line 229, in check_status "on" if self.is_turned_on(response, pluglabel) else "off" File "/home/printer/OctoPrint/venv/lib/python3.10/site-packages/octoprint_tuyasmartplug/init.py", line 242, in is_turned_on return data and plug and data.get("dps", {}).get(str(plug["slot"])) AttributeError: 'bytes' object has no attribute 'get'

shaddow501 avatar Jun 26 '22 18:06 shaddow501

Are you running Ubuntu 22.04 by chance? I had the same issue and ended up going back to ubuntu 20.04 and it works great still. Something to do with python compatibility problems with 22.04.

swilsonnc avatar Dec 30 '22 03:12 swilsonnc