mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
api/pupdevices: add Powered Up Light
This commit is contained in:
@@ -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 |
@@ -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
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user