device: add support for config change feature
This commit is contained in:
parent
beb9dfdab8
commit
7b6b11ac73
|
@ -350,6 +350,13 @@ class Device:
|
||||||
self._feature_settings_checked = _check_feature_settings(self, self._settings)
|
self._feature_settings_checked = _check_feature_settings(self, self._settings)
|
||||||
return self._settings
|
return self._settings
|
||||||
|
|
||||||
|
def set_configuration(self, configuration, no_reply=False):
|
||||||
|
if self.online and self.protocol >= 2.0:
|
||||||
|
_hidpp20.config_change(self, configuration, no_reply=no_reply)
|
||||||
|
|
||||||
|
def reset(self, no_reply=False):
|
||||||
|
self.set_configuration(0, no_reply)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def persister(self):
|
def persister(self):
|
||||||
if not self._persister:
|
if not self._persister:
|
||||||
|
|
|
@ -65,7 +65,7 @@ FEATURE = _NamedInts(
|
||||||
DEVICE_GROUPS=0x0006,
|
DEVICE_GROUPS=0x0006,
|
||||||
DEVICE_FRIENDLY_NAME=0x0007,
|
DEVICE_FRIENDLY_NAME=0x0007,
|
||||||
KEEP_ALIVE=0x0008,
|
KEEP_ALIVE=0x0008,
|
||||||
RESET=0x0020, # "Config Change"
|
CONFIG_CHANGE=0x0020,
|
||||||
CRYPTO_ID=0x0021,
|
CRYPTO_ID=0x0021,
|
||||||
TARGET_SOFTWARE=0x0030,
|
TARGET_SOFTWARE=0x0030,
|
||||||
WIRELESS_SIGNAL_STRENGTH=0x0080,
|
WIRELESS_SIGNAL_STRENGTH=0x0080,
|
||||||
|
@ -1560,3 +1560,7 @@ def get_remaining_pairing(device):
|
||||||
if result:
|
if result:
|
||||||
result = _unpack('!B', result[:1])[0]
|
result = _unpack('!B', result[:1])[0]
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def config_change(device, configuration, no_reply=False):
|
||||||
|
return feature_request(device, FEATURE.CONFIG_CHANGE, 0x00, configuration, no_reply=no_reply)
|
||||||
|
|
Loading…
Reference in New Issue