Skip to content

adafruit_bus_device writeto(..., stop=stop) deprecated #53

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

Closed
anecdata opened this issue Jul 24, 2020 · 6 comments
Closed

adafruit_bus_device writeto(..., stop=stop) deprecated #53

anecdata opened this issue Jul 24, 2020 · 6 comments

Comments

@anecdata
Copy link
Member

anecdata commented Jul 24, 2020

Using:
CircuitPython 6.0.0-alpha.2 on 2020-07-23
adafruit-circuitpython-bundle-6.x-mpy-20200723

CircuitPython 6.0.0 release notes:

Breaking changes since 5.x:
• The stop kwarg has been removed from I2C.writeto(). If no stop is desired, then use writeto_then_readfrom.

code.py error (occurs with various I2C device libraries):

  File "adafruit_register/i2c_bit.py", line 70, in __set__
  File "adafruit_register/i2c_bit.py", line 70, in __set__
  File "adafruit_bus_device/i2c_device.py", line 104, in write
TypeError: extra keyword arguments given

adafruit_bus_device/i2c_device.py#L104:
self.i2c.writeto(self.device_address, buf, start=start, end=end, stop=stop)

@evaherrada evaherrada added the bug label Jul 24, 2020
@tannewt
Copy link
Member

tannewt commented Jul 24, 2020

Looks like we just need to remove it from the call and function signature. Libraries shouldn't use it anymore.

@dhalbert
Copy link
Contributor

Besides BusDevice, these libraries also still use or provide stop=:

ibraries/helpers/bitbangio/adafruit_bitbangio.py:124:    def writeto(self, address, buffer, *, start=0, end=None, st
op=True):
libraries/helpers/bitbangio/adafruit_bitbangio.py:151:        stop=True
libraries/helpers/bitbangio/adafruit_bitbangio.py:161:            self.writeto(address, buffer_out, start=out_start, 
end=out_end, stop=stop)

libraries/drivers/tca9584a/adafruit_tca9548a.py:100:                stop=False,
libraries/drivers/mlx90393/adafruit_mlx90393.py:165:                i2c.write(payload, stop=False)

@anecdata
Copy link
Member Author

anecdata commented Jul 25, 2020

adafruit/circuitpython#3206 and adafruit/circuitpython#3207 just need the underlying change, those libraries per se are OK. I suspect most I2C device libraries will fail due to bus_device, and most uses are stop=True or equivalent.

How long do we wait on "good first issue"? I'm happy to PR this bus_device library if there are no takers.

@jerryneedell
Copy link

I can’t deal with this tonight. I can look at it tomorrow if it has not been resolved.

@jepler
Copy link
Contributor

jepler commented Jul 26, 2020

I think I've filed issues for all the repos that were using stop=, according to Dan's list above

@jepler jepler linked a pull request Jul 26, 2020 that will close this issue
@anecdata
Copy link
Member Author

Fixed with #55 merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants