fishbigger / TapoP100

A module for controlling the TP-Link Tapo P100 Plugs
MIT License
566 stars 138 forks source link

`KeyError: '-1802'` when `p110.turnOffWithDelay(1200)` #112

Open The-Judge opened 1 year ago

The-Judge commented 1 year ago

When p110.turnOffWithDelay(delay=1200) is used, the timer (20 minutes) is set on the device, but the code raises a KeyError:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/switch.py", line 20, in get_switch_trigger
    activate_switch(
  File "/usr/src/app/p110.py", line 11, in activate_switch
    p110.turnOffWithDelay(delay=delay)
  File "/usr/local/lib/python3.11/site-packages/PyP100/PyP100.py", line 355, in turnOffWithDelay
    errorMessage = self.errorCodes[str(errorCode)]
                   ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: '-1802'
CodingFactoryT commented 8 months ago

I have the same issue.