Skip to content

Commit 8540d63

Browse files
committed
Better docstring
Fix __str__ style
1 parent 1b47dab commit 8540d63

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

droneapi/lib/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ class Battery(object):
173173
"""
174174
Battery info available
175175
176-
:param voltage: Battery voltage in millivolts
177-
:param current: Battery current, in 10 * milliamperes, -1: autopilot does not measure the current
178-
:param level: Remaining battery energy, -1: autopilot estimate the remaining battery
176+
:param voltage: Battery voltage in millivolts.
177+
:param current: Battery current, in 10 * milliamperes. ``None`` if the autopilot does not support current measurement.
178+
:param level: Remaining battery energy. ``None`` if the autopilot cannot estimate the remaining battery.
179179
"""
180180
def __init__(self, voltage, current, level):
181181
self.voltage = voltage / 1000.0
@@ -189,7 +189,7 @@ def __init__(self, voltage, current, level):
189189
self.level = level
190190

191191
def __str__(self):
192-
return "Battery voltage: {}, current: {}, level: {}".format(self.voltage, self.current, self.level)
192+
return "Battery:voltage={},current={},level={}".format(self.voltage, self.current, self.level)
193193

194194

195195
class VehicleMode(object):

0 commit comments

Comments
 (0)