Skip to content

Commit e43b4d5

Browse files
committed
Merge pull request #24 from ddemidov/power-supply
Implement PowerSupply.measured_{amps,volts}
2 parents 94f981a + 8f41df2 commit e43b4d5

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
@@ -1880,6 +1880,21 @@ def type(self):
18801880

18811881

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

18851900
class LegoPort(Device):

0 commit comments

Comments
 (0)