David Lechner
db65f8d646
api: add type hints for v3
...
This updates the type hints for the current v3 API.
2020-12-28 18:47:11 -06:00
Laurens Valk
57ff8312f3
api/iodevices/PUPDevice: add info() method
2020-12-18 13:20:17 +01:00
Laurens Valk
1e751d6afc
api/iodevices/LUMPDevice: drop write method
...
EV3 UART devices do not support writing.
2020-12-14 10:08:09 +01:00
Laurens Valk
aaf98308f7
api/iodevices/PUPDevice: copy from LUMPDevice
...
Powered Up devices have many differences compared to EV3 UART devices, so it is better to split them to dedicated classes.
The biggest difference is that PUPDevice class will allow writing to sensors and toggling battery power to the device.
2020-12-14 10:07:13 +01:00
David Lechner
166ce2109f
doc: Use verbs ending in s for functions/methods
...
The documentation currently has a mix of with and without the `s`.
Adding an `s` is consistent with most API documentation in general,
especially more modern documentation.
2020-03-24 12:11:53 +01:00
Laurens Valk
9dd1f45ccd
doc: drop default argument in docstring
...
This is visible in the function definition, so no need to repeat it.
2020-03-15 20:35:36 +01:00
David Lechner
6ed6ec0378
api: remove empty () on class declarations
...
Python allows this syntax and some even consider it good style.
2020-03-12 12:46:09 -05:00
Laurens Valk
066983a5e1
LICENSE: Update year and authors
...
Also add SPDX-License-Identifier: MIT to API source files for clarity.
2020-03-05 10:33:48 +01:00
Laurens Valk
c02cc456f7
api/iodevices/Ev3devSensor: add device index
...
This makes it easy to find the sensor to access additional features through the ev3dev lego-sensor and lego-port classes.
2020-02-25 10:29:40 +01:00
Laurens Valk
0d068b17f2
api/iodevices/AnalogSensor: remove type check
...
This makes it consistent with the UARTDevice and I2CDevice class.
The `Ev3devSensor` class can be used instead if auto id is desired.
2020-02-20 16:23:26 +01:00
Laurens Valk
6337b6c451
api/iodevices: Separate Ev3devSensor class
...
This is not just an alias for a LUMPDevice because it works differently. On ev3dev, sensor modes are set using strings.
Also, simplify the introductory text and reasons for using it.
2020-02-03 13:54:18 +01:00
Laurens Valk
2bd149a121
doc/iodevices: reorganize TOC
...
Make the heading levels match the module. No subcategories, but say which devices are available on EV3 only.
2020-02-03 11:35:43 +01:00
Laurens Valk
3e5f552591
api/iodevices: update i2c doc and sample
...
Reflect that we read one byte by default.
By popular request, also allow a second way to send one byte, by specifying a register with no data.
2020-02-03 10:37:32 +01:00
Laurens Valk
1bafa67979
api/iodevices: add Ev3devSensor
2020-01-09 22:21:42 +01:00
Laurens Valk
5a2d1f5406
api/iodevices: simplify LUMPDevice API
...
All these device can do is read or write values at a particular mode. There is also no need for separate mode setters.
2020-01-06 17:48:03 +01:00
Laurens Valk
af3954989a
doc/iodevices: add note about EV3 compatibility.
...
Some iodevices are only available on EV3 (for now or forever).
2020-01-02 16:02:10 +01:00
Laurens Valk
f73e7f08bc
api/iodevices: add LUMPDevice
...
This can be used to interface with LPF2 and EV3 sensors that use the LEGO UART Messaging Protocol.
2020-01-02 15:53:44 +01:00
Laurens Valk
21a0b8766e
api: rename customdevices to iodevices
...
These devices are not always custom. Rather, the classes in this module are very generic and apply to a wide range of input/output devices.
2020-01-01 16:41:29 +01:00