Browse Source

Initiate python library files

master
Burathar 5 years ago
parent
commit
6217b0d303
  1. 0
      __init__.py
  2. 26
      keyboard.py

0
__init__.py

26
keyboard.py

@ -0,0 +1,26 @@ @@ -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…
Cancel
Save