You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
685 B

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