mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-07-28 04:07:46 +00:00
pybricks.common.Battery: Add typing.
This commit is contained in:
+10
-7
@@ -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
|
||||
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user