mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
pybricks.common.Charger: Add typing.
This commit is contained in:
+19
-13
@@ -828,33 +828,39 @@ class Battery:
|
||||
class Charger:
|
||||
"""Get the status of a battery charger."""
|
||||
|
||||
def connected(self):
|
||||
"""Checks whether a charger is connected via USB.
|
||||
def connected(self) -> bool:
|
||||
"""connected() -> bool
|
||||
|
||||
Checks whether a charger is connected via USB.
|
||||
|
||||
Returns:
|
||||
bool: ``True`` if a charger is connected, ``False`` if not.
|
||||
``True`` if a charger is connected, ``False`` if not.
|
||||
"""
|
||||
|
||||
def status(self):
|
||||
"""Gets the status of the battery charger, represented by one of the
|
||||
def status(self) -> int:
|
||||
"""status() -> int
|
||||
|
||||
Gets the status of the battery charger, represented by one of the
|
||||
following values. This corresponds to the battery light indicator
|
||||
right next to the USB port.
|
||||
|
||||
0. Not charging (off).
|
||||
1. Charging (red).
|
||||
2. Charging is complete (green).
|
||||
3. There is a problem with the charger (yellow).
|
||||
0. Not charging (light is off).
|
||||
1. Charging (light is red).
|
||||
2. Charging is complete (light is green).
|
||||
3. There is a problem with the charger (light is yellow).
|
||||
|
||||
Returns:
|
||||
int: Status value.
|
||||
Status value.
|
||||
"""
|
||||
pass
|
||||
|
||||
def current(self):
|
||||
"""Gets the charging current.
|
||||
def current(self) -> int:
|
||||
"""current() -> int: mA
|
||||
|
||||
Gets the charging current.
|
||||
|
||||
Returns:
|
||||
:ref:`current`: Charging current.
|
||||
Charging current.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@@ -6,11 +6,6 @@ from typing import Collection, Iterable, Optional, Tuple, Union, overload
|
||||
from .geometry import Axis, Matrix, vector
|
||||
from .parameters import Button, Color, Direction, Side, Stop, Port
|
||||
|
||||
class Charger:
|
||||
def connected(self) -> bool: ...
|
||||
def status(self) -> int: ...
|
||||
def current(self) -> int: ...
|
||||
|
||||
class SimpleAccelerometer:
|
||||
def acceleration(self) -> Tuple[int, int, int]: ...
|
||||
def up(self) -> Side: ...
|
||||
|
||||
Reference in New Issue
Block a user