pybricks.common.Battery: Add typing.

This commit is contained in:
Laurens Valk
2022-05-28 11:23:21 +02:00
parent 3548ff47ce
commit 453332201e
2 changed files with 10 additions and 11 deletions
+10 -7
View File
@@ -793,20 +793,23 @@ class Keypad:
class Battery:
"""Get the status of a battery."""
def voltage(self):
"""Gets the voltage of the battery.
def voltage(self) -> int:
"""voltage() -> int: mV
Gets the voltage of the battery.
Returns:
:ref:`voltage`: Battery voltage.
Battery voltage.
"""
pass
def current(self):
"""Gets the current supplied by the battery.
def current(self) -> int:
"""current() -> int: mA
Gets the current supplied by the battery.
Returns:
:ref:`current`: Battery current.
Battery current.
"""
pass
-4
View File
@@ -6,10 +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 Battery:
def voltage(self) -> int: ...
def current(self) -> int: ...
class Charger:
def connected(self) -> bool: ...
def status(self) -> int: ...