@@ -43,7 +43,7 @@ class I2CDevice:
43
43
device = I2CDevice(i2c, 0x70)
44
44
bytes_read = bytearray(4)
45
45
with device:
46
- device.read_into (bytes_read)
46
+ device.readinto (bytes_read)
47
47
# A second transaction
48
48
with device:
49
49
device.write(bytes_read)
@@ -62,7 +62,7 @@ def __init__(self, i2c, device_address):
62
62
self .i2c = i2c
63
63
self .device_address = device_address
64
64
65
- def read_into (self , buf , ** kwargs ):
65
+ def readinto (self , buf , ** kwargs ):
66
66
"""
67
67
Read into ``buf`` from the device. The number of bytes read will be the
68
68
length of ``buf``.
@@ -77,6 +77,14 @@ def read_into(self, buf, **kwargs):
77
77
"""
78
78
self .i2c .readfrom_into (self .device_address , buf , ** kwargs )
79
79
80
+ def read_into (self , buf , ** kwargs ):
81
+ """
82
+ .. warning:: This method will be deprecated at some time in the future.
83
+ Please use `readinto`() instead. `readinto`() is functionally
84
+ equivalent to read_into(), same parameters and same actions.
85
+ """
86
+ self .i2c .readfrom_into (self .device_address , buf , ** kwargs )
87
+
80
88
def write (self , buf , ** kwargs ):
81
89
"""
82
90
Write the bytes from ``buffer`` to the device. Transmits a stop bit if
0 commit comments