micropython / micropython/micropython-lib

Unexpectedly, notify method ask for a connection argument

Open
#721 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
1.1k
Avg merge
7d 6h
Merged PRs (30d)
3

Description

Hello,

In the README.md:
https://github.com/micropython/micropython-lib/tree/master/micropython/bluetooth/aioble
it is stated that the notify method take one optional argument:

temp_char.notify(b'optional data')

but if I call it without any argument I get:

TypeError: function takes 2 positional arguments but 1 were given

In server.py the notify method take a connection object as 2nd argument:

def notify(self, connection, data=None):

server.py module wouldn't be able to get the conenction object internally ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the notify example in README.md with the implementation in server.py, focusing on how the connection argument is supplied. First determine the intended API from the surrounding aioble code and issue context; done means the documented call and the method signature agree, with the behavior verified by the relevant tests if they exist.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.