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

Error in learn function #132

Open
paulearley opened this issue Nov 18, 2024 · 0 comments
Open

Error in learn function #132

paulearley opened this issue Nov 18, 2024 · 0 comments

Comments

@paulearley
Copy link

I installed your promising Broadlink app on an otherwise empty Pi3 running docker. I discovered my BroadLink Pro fine. Then an error occurred: failure to learn. Steps to reproduce:

  1. Click the plus sign next to commands.
  2. Prompted to press command button
  3. This error was reported in the pi login:
    Traceback (most recent call last):
    File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/site-packages/flask_cors/extension.py", line 194, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
    ^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File "/usr/local/lib/python3.11/site-packages/flask/_compat.py", line 39, in reraise
    raise value
    File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
    ^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functionsrule.endpoint
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/app/./api.py", line 68, in learn
    return jsonify(learn_command(ip_address, command_name, host_ip))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/site-packages/flask/json/init.py", line 370, in jsonify
    dumps(data, indent=indent, separators=separators) + "\n",
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/site-packages/flask/json/init.py", line 211, in dumps
    rv = _json.dumps(obj, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/json/init.py", line 238, in dumps
    **kw).encode(obj)
    ^^^^^^^^^^^
    File "/usr/local/lib/python3.11/json/encoder.py", line 200, in encode
    chunks = self.iterencode(o, _one_shot=True)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/json/encoder.py", line 258, in iterencode
    return _iterencode(o, 0)
    ^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/site-packages/flask/json/init.py", line 100, in default
    return _json.JSONEncoder.default(self, o)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/json/encoder.py", line 180, in default
    raise TypeError(f'Object of type {o.class.name} '
    TypeError: Object of type Exception is not JSON serializable

I do very little python programming, could you look into this?
Paul Earley

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