api/pupdevices: add Powered Up Light

This commit is contained in:
Laurens Valk
2020-06-08 15:26:19 +02:00
parent c536081dea
commit 80840396aa
5 changed files with 29 additions and 2 deletions
+1
View File
@@ -13,3 +13,4 @@
1 15 600 -266 158 -1 0 0 0 -1 0 0 0 1 u9218c01.dat
1 15 1130 -280 240 1 0 0 0 1 0 0 0 1 37316.dat
1 15 1290 -280 220 1 0 0 0 1 0 0 0 1 37308.dat
1 0 690 -312 530 0 0 1 0 1 0 -1 0 0 22168.dat
Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

+13
View File
@@ -211,3 +211,16 @@ Force Sensor
.. automethod:: pybricks.pupdevices::RemoteControl.light.off
.. automethod:: pybricks.pupdevices::RemoteControl.buttons.pressed
Light
^^^^^^^^^^^^^^^^^^^^^^^^^
.. figure:: ../api/images/light.png
:width: 90 %
.. autoclass:: pybricks.pupdevices.Light
:no-members:
.. automethod:: pybricks.pupdevices.Light.on
.. automethod:: pybricks.pupdevices.Light.off
+1 -1
View File
@@ -393,7 +393,7 @@ class Light:
"""Control a single-color light."""
def on(self, brightness=100):
"""Turn on the light at the specified brightness.
"""Turns on the light at the specified brightness.
Arguments:
brightness (:ref:`brightness`):
+14 -1
View File
@@ -5,7 +5,7 @@
from ._common import (KeyPad as _KeyPad, Accelerometer as _Accelerometer,
ColorLight as _ColorLight, Motor as _Motor,
LightArray as _LightArray)
LightArray as _LightArray, Light as _Light)
class Motor(_Motor):
@@ -311,3 +311,16 @@ class ForceSensor:
"""
pass
class Light(_Light):
"""LEGO® Powered Up Light."""
def __init__(self, port):
"""
Arguments:
port (Port): Port to which the device is connected.
"""
pass