Skip to content

Commit 8f41df2

Browse files
committed
Implement PowerSupply.measured_{amps,volts}
1 parent 5442a28 commit 8f41df2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ev3dev.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,6 +1878,21 @@ def type(self):
18781878

18791879

18801880
#~autogen
1881+
1882+
@property
1883+
def measured_amps(self):
1884+
"""
1885+
The measured current that the battery is supplying (in amps)
1886+
"""
1887+
return self.measured_current / 1e6
1888+
1889+
@property
1890+
def measured_volts(self):
1891+
"""
1892+
The measured voltage that the battery is supplying (in volts)
1893+
"""
1894+
return self.measured_voltage / 1e6
1895+
18811896
#~autogen generic-class classes.legoPort>currentClass
18821897

18831898
class LegoPort(Device):

0 commit comments

Comments
 (0)