Burathar
5 years ago
2 changed files with 26 additions and 0 deletions
@ -0,0 +1,26 @@ |
|||||||
|
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 |
Loading…
Reference in new issue