mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-09-25 11:29:04 +02:00
stash
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
from typing import List
|
||||
|
||||
|
||||
class XAPClient:
|
||||
"""XAP device discovery
|
||||
"""
|
||||
|
||||
@@ -61,3 +61,7 @@ class XAPRoutes():
|
||||
REMAPPING_SET_ENCODER_KEYCODE = b'\x05\x04'
|
||||
# LIGHTING
|
||||
LIGHTING_CAPABILITIES_QUERY = b'\x06\x01'
|
||||
LIGHTING_RGBLIGHT = b'\x06\x03'
|
||||
LIGHTING_RGBLIGHT_CAPABILITIES_QUERY = b'\x06\x03\x01'
|
||||
LIGHTING_RGBLIGHT_GET_ENABLED_EFFECTS = b'\x06\x03\x02'
|
||||
LIGHTING_RGBLIGHT_GET_CONFIG = b'\x06\x03\x03'
|
||||
|
||||
@@ -59,6 +59,29 @@ class XAPResponse(namedtuple('XAPResponse', 'token flags length data')):
|
||||
return self.fmt.pack(*list(self))
|
||||
|
||||
|
||||
class XAPConfigRgblight(namedtuple('XAPConfigRgblight', 'enable mode hue sat val speed')):
|
||||
fmt = Struct('<BBBBBB')
|
||||
|
||||
def __new__(cls, *args):
|
||||
return super().__new__(cls, *args)
|
||||
|
||||
@classmethod
|
||||
def from_bytes(cls, data):
|
||||
return cls._make(cls.fmt.unpack(data))
|
||||
|
||||
def to_bytes(self):
|
||||
return self.fmt.pack(*list(self))
|
||||
|
||||
|
||||
# Spec structs
|
||||
# TODO: gen outbound object for board_identifiers
|
||||
# TODO: gen inbound object for get_keymap_keycode
|
||||
# TODO: gen inbound object for get_encoder_keycode
|
||||
# TODO: gen inbound object for set_keymap_keycode
|
||||
# TODO: gen inbound object for set_encoder_keycode
|
||||
# TODO: gen outbound object for get_config
|
||||
|
||||
|
||||
class XAPSecureStatus(IntEnum):
|
||||
LOCKED = 0x00
|
||||
UNLOCKING = 0x01
|
||||
|
||||
Reference in New Issue
Block a user