Skip to content

Commit

Permalink
re-arranged the PowerSupply class
Browse files Browse the repository at this point in the history
  • Loading branch information
attie committed Dec 4, 2019
1 parent 5d660ee commit 2e390cf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions koradctl/psu.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@ def get_output_current(self) -> Reading:
response = self.issue_command_trim('IOUT1?')
return pretty_reading(response, 'I')

def get_output_power(self) -> Reading:
return self.get_output_readings()[2]


def get_output_readings(self) -> Tuple[Reading, Reading, Reading]:
i = self.get_output_current()
v = self.get_output_voltage()
p = pretty_reading(i.value * v.value, 'W')
return i, v, p

def get_output_power(self) -> Reading:
return self.get_output_readings()[2]

0 comments on commit 2e390cf

Please sign in to comment.