Skip to content

Commit

Permalink
Add FreeBuds SE profile, close #17
Browse files Browse the repository at this point in the history
  • Loading branch information
melianmiko committed Nov 27, 2023
1 parent 3d3cf70 commit ee86e4d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Features:
- Open source and free forever

Supported devices:
- HUAWEI FreeBuds SE
- HUAWEI FreeBuds 4i
- HUAWEI FreeLace Pro
- HONOR Earbuds 2 Lite
Expand Down
Binary file added docs/research.ods
Binary file not shown.
4 changes: 3 additions & 1 deletion src/openfreebuds/device/huawei/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
from openfreebuds.device.huawei.profiles import FreeLaceProDevice, FreeBuds4iDevice
from openfreebuds.device.huawei.profiles import FreeLaceProDevice, FreeBuds4iDevice, FreeBudsSEDevice

profiles = {
"HUAWEI FreeBuds 4i": FreeBuds4iDevice,
"HUAWEI FreeLace Pro": FreeLaceProDevice,
"HUAWEI FreeBuds SE" : FreeBudsSEDevice
}

# (implementation_level, profile)
devices = {
"HUAWEI FreeBuds 4i": ("full", FreeBuds4iDevice),
"HONOR Earbuds 2 Lite": ("full", FreeBuds4iDevice),
"HUAWEI FreeLace Pro": ("full", FreeLaceProDevice),
"HUAWEI FreeBuds SE": ("full", FreeBudsSEDevice),

"HUAWEI FreeBuds 5i": ("partial", FreeBuds4iDevice),
"HUAWEI FreeBuds Pro 2": ("partial", FreeBuds4iDevice),
Expand Down
12 changes: 12 additions & 0 deletions src/openfreebuds/device/huawei/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,15 @@ def __init__(self, address):
TwsAutoPauseHandler(),
VoiceLanguageHandler(),
]


class FreeBudsSEDevice(GenericHuaweiSppDevice):
def __init__(self, address):
super().__init__(address)
self.handlers = [
DropLogsHandler(),
DeviceInfoHandler(),
BatteryHandler(),
DoubleTapConfigHandler(),
VoiceLanguageHandler(),
]
2 changes: 2 additions & 0 deletions src/openfreebuds_applet/ui/menu_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ def __init__(self, manager: FreebudsManager):
def on_build(self):
device = self.manager.device
current = device.find_property("anc", "mode", -1)
if current == -1:
return
next_mode = (current + 1) % 3

for a in range(0, 3):
Expand Down

0 comments on commit ee86e4d

Please sign in to comment.