Skip to content

Commit

Permalink
api/hubs: add CPlusHub
Browse files Browse the repository at this point in the history
  • Loading branch information
laurensvalk committed Jun 5, 2020
1 parent a0a9efe commit b198049
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/api/hubs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ Select your programmable hub using the buttons below.

.. figure:: ../api/images/cplushub.png
:height: 15 em

.. include:: hubs_cplushub.inc
15 changes: 15 additions & 0 deletions doc/api/hubs_cplushub.inc
Original file line number Diff line number Diff line change
@@ -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

6 changes: 6 additions & 0 deletions pybricks/hubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit b198049

Please sign in to comment.