-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pro3: add voice eq preset; pro: initial profile
- Loading branch information
1 parent
f466c45
commit 3d574f5
Showing
6 changed files
with
93 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/openfreebuds/device/huawei/spp_handlers/multi_device_toggle.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from openfreebuds.device.huawei.generic.spp_handler import HuaweiSppHandler | ||
from openfreebuds.device.huawei.generic.spp_package import HuaweiSppPackage | ||
|
||
|
||
class MultiDeviceToggleHandler(HuaweiSppHandler): | ||
""" | ||
Enable/disable multi-device support (pro 3, maybe 5i) | ||
""" | ||
handler_id = "multi_device_toggle" | ||
handle_commands = ( | ||
b"\x2b\x2f" | ||
) | ||
ignore_commands = ( | ||
b"\x2b\x2e", | ||
) | ||
handle_props = ( | ||
("multi_device", "enabled"), | ||
) | ||
|
||
def on_init(self): | ||
self.device.send_package(HuaweiSppPackage(b"\x2b\x2f", [ | ||
(1, b""), | ||
])) | ||
|
||
def on_prop_changed(self, group: str, prop: str, value): | ||
pkg = HuaweiSppPackage(b"\x2b\x2e", [ | ||
(1, 1 if value else 0), | ||
]) | ||
self.device.send_package(pkg) | ||
self.on_init() | ||
|
||
def on_package(self, package: HuaweiSppPackage): | ||
value = package.find_param(1) | ||
|
||
if len(value) == 1: | ||
value = int(value[0]) | ||
self.device.put_property("multi_device", "enabled", value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters