Skip to content

Commit

Permalink
Release the device once done with status or set_fixed_speed
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasmalacofilho committed Oct 20, 2019
1 parent 8f75d44 commit 0543445
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions liquidctl/driver/seasonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def get_status(self, **kwargs):
status.append((f'{name} output voltage', self._get_vout(i), 'V'))
status.append((f'{name} output current', self._get_float(CMD.READ_IOUT, page=i), 'A'))
status.append((f'{name} output power', self._get_float(CMD.READ_POUT, page=i), 'W'))
self.device.release()
return status

def set_fixed_speed(self, channel, duty, **kwargs):
Expand All @@ -98,6 +99,7 @@ def set_fixed_speed(self, channel, duty, **kwargs):
if ret[0] == 0xaa and ret[1] == 0x28:
break
assert ret, f'invalid response (attempts={attempts})'
self.device.release()

def _write(self, data):
padding = [0x0]*(_WRITE_LENGTH - len(data))
Expand Down

0 comments on commit 0543445

Please sign in to comment.