Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _load_driver(self) -> None:
if not self._driver:
self._driver = INJECTOR.get(Optional[KrakenTwoDriver])
if self._driver:
self._driver.initialize()
else:
raise ValueError("Kraken USB interface error (check USB cable connection)")
def has_supported_kraken(self) -> bool:
return self._driver is not None or INJECTOR.get(Optional[KrakenTwoDriver]) is not None
#!/usr/bin/python3
from collections import namedtuple
from krakenx import profile
from liquidctl.driver.kraken_two import KrakenTwoDriver
VENDOR = 0x1e71
PRODUCT = 0x170e
CRITICAL_TEMP = 60
class KrakenX52(KrakenTwoDriver):
DEFAULT_COLOR = (255, 0, 0)
Mode = namedtuple('Mode', ['name', 'lname', 'uses_text_color'])
MODE_SOLID = Mode('Solid', 'fixed', False)
COLOR_MODES = [
Mode('Off', 'off', False),
MODE_SOLID,
Mode('SolidAll', 'super-fixed', True),
Mode('Fading', 'fading', False),
Mode('SpectrumWave', 'spectrum-wave', False),
Mode('CustomWave', 'super-wave', True),
Mode('Marquee', 'marquee-3', False),
Mode('CoveringMarquee', 'covering-marquee', False),
Mode('Alternating', 'alternating', False),
Mode('MovingAlternating', 'moving-alternating', False),
def provide_kraken_two_driver(self) -> Optional[KrakenTwoDriver]:
LOG.debug("provide KrakenTwoDriver")
return next((dev for dev in find_all_supported_devices() if isinstance(dev, KrakenTwoDriver)), None)