diff --git a/doc/api/hubs.rst b/doc/api/hubs.rst index 03a3cfa..23380fa 100644 --- a/doc/api/hubs.rst +++ b/doc/api/hubs.rst @@ -38,3 +38,5 @@ Select your programmable hub using the buttons below. .. figure:: ../api/images/cplushub.png :height: 15 em + + .. include:: hubs_cplushub.inc diff --git a/doc/api/hubs_cplushub.inc b/doc/api/hubs_cplushub.inc new file mode 100644 index 0000000..a1e833a --- /dev/null +++ b/doc/api/hubs_cplushub.inc @@ -0,0 +1,15 @@ +.. autoclass:: pybricks.hubs.CPlusHub + :no-members: + + .. rubric:: Using the hub status light + + .. automethod:: pybricks.hubs::CPlusHub.light.on + + .. automethod:: pybricks.hubs::CPlusHub.light.off + + .. rubric:: Using the battery + + .. automethod:: pybricks.hubs::CPlusHub.battery.voltage + + .. automethod:: pybricks.hubs::CPlusHub.battery.current + diff --git a/pybricks/hubs.py b/pybricks/hubs.py index ba27612..2476b91 100644 --- a/pybricks/hubs.py +++ b/pybricks/hubs.py @@ -26,3 +26,9 @@ class CityHub: """LEGO® Powered Up City Hub.""" battery = _Battery() light = _ColorLight() + + +class CPlusHub: + """LEGO® Technic Control+ Hub.""" + battery = _Battery() + light = _ColorLight()