Skip to content

message callback unknown retain parameter #60

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

Merged
merged 1 commit into from
Jul 16, 2018

Conversation

erickellerek1
Copy link
Contributor

the message callback does not get any retain parameter. fixing the following trace...

Traceback (most recent call last):
  File "./pubsub.py", line 63, in <module>
    client.loop_blocking()
  File "/usr/local/lib/python3.5/dist-packages/Adafruit_IO/mqtt_client.py", line 152, in loop_blocking
    self._client.loop_forever()
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 1481, in loop_forever
    rc = self.loop(timeout, max_packets)
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 1003, in loop
    rc = self.loop_read(max_packets)
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 1284, in loop_read
    rc = self._packet_read()
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 1849, in _packet_read
    rc = self._packet_handle()
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 2305, in _packet_handle
    return self._handle_publish()
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 2500, in _handle_publish
    self._handle_on_message(message)
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 2647, in _handle_on_message
    self.on_message(self, self._userdata, message)
  File "/usr/local/lib/python3.5/dist-packages/Adafruit_IO/mqtt_client.py", line 108, in _mqtt_message
    self.on_message(self, feed, payload)
TypeError: message() missing 1 required positional argument: 'retain'

Thank you for creating a pull request to contribute to Adafruit's GitHub code!
Before you open the request please review the following guidelines and tips to
help it be more easily integrated:

  • Describe the scope of your change--i.e. what the change does and what parts
    of the code were modified.
    This will help us understand any risks of integrating
    the code.

  • Describe any known limitations with your change. For example if the change
    doesn't apply to a supported platform of the library please mention it.

  • Please run any tests or examples that can exercise your modified code. We
    strive to not break users of the code and running tests/examples helps with this
    process.

Thank you again for contributing! We will try to test and integrate the change
as soon as we can, but be aware we have many GitHub repositories to manage and
can't immediately respond to every request. There is no need to bump or check in
on a pull request (it will clutter the discussion of the request).

Also don't be worried if the request is closed or not integrated--sometimes the
priorities of Adafruit's GitHub code (education, ease of use) might not match the
priorities of the pull request. Don't fret, the open source community thrives on
forks and GitHub makes it easy to keep your changes in a forked repo.

After reviewing the guidelines above you can delete this text from the pull request.

the message callback does not get any retain parameter. fixing the following trace...

```
Traceback (most recent call last):
  File "./pubsub.py", line 63, in <module>
    client.loop_blocking()
  File "/usr/local/lib/python3.5/dist-packages/Adafruit_IO/mqtt_client.py", line 152, in loop_blocking
    self._client.loop_forever()
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 1481, in loop_forever
    rc = self.loop(timeout, max_packets)
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 1003, in loop
    rc = self.loop_read(max_packets)
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 1284, in loop_read
    rc = self._packet_read()
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 1849, in _packet_read
    rc = self._packet_handle()
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 2305, in _packet_handle
    return self._handle_publish()
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 2500, in _handle_publish
    self._handle_on_message(message)
  File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 2647, in _handle_on_message
    self.on_message(self, self._userdata, message)
  File "/usr/local/lib/python3.5/dist-packages/Adafruit_IO/mqtt_client.py", line 108, in _mqtt_message
    self.on_message(self, feed, payload)
TypeError: message() missing 1 required positional argument: 'retain'
```
@brentru
Copy link
Member

brentru commented Jul 16, 2018

Thanks for the submission, I just tested this on hardware. Looks good and pulling in...

@brentru brentru closed this Jul 16, 2018
@brentru brentru reopened this Jul 16, 2018
@brentru brentru merged commit 4f3609b into adafruit:master Jul 16, 2018
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

Successfully merging this pull request may close these issues.

2 participants