Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
The-Judge opened this issue May 14, 2023 · 0 comments
Open

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

The-Judge opened this issue May 14, 2023 · 0 comments

Comments

@The-Judge
Copy link

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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant