Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _exec(self, writebit, command, data=None):
self._write([_SLAVE_ADDRESS | WriteBit(writebit), CMD(command)] + (data or []))
return self._read()
def _get_fan_control_mode(self):
"""Get hardware/software fan control mode."""
return FanControlMode(self._exec(WriteBit.READ, _CORSAIR_FAN_CONTROL_MODE)[2])
def _get_timedelta(self, command):
"""Get timedelta with `command`."""
secs = int.from_bytes(self._exec(WriteBit.READ, command)[2:], byteorder='little')
return timedelta(seconds=secs)