import openrazer.client import json import warnings from pathlib import Path class keyboard: """Provides tooling to call openrazer.client.device""" def __init__(self): self.kbd = None self.find_keyboard() if self.kbd is None: warnings.warn('Compatible keyboard was not detected', RuntimeWarning) def find_keyboard(self): if self.kbd is not None: print('keyboard was already initiated') return devman = openrazer.client.DeviceManager() for device in devman.devices: if (device.name == "Razer BlackWidow Chroma V2"): self.kbd = device return