Skip to content

Commit 44fddd1

Browse files
committed
[btdevicemanager] cherry pick OE-A updates
1 parent 9809a33 commit 44fddd1

6 files changed

Lines changed: 58 additions & 20 deletions

File tree

btdevicesmanager/CONTROL/control

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ Package: enigma2-plugin-extensions-btdevicesmanager
22
Version: 1.0-r0
33
Description: this is bt devices manger to pair e.x keyboard or mouse
44
Maintainer: a4tech
5-
Depends: python3-pexpect, bluez5, btinit
6-
5+
Depends: bluez4-testtools, bluez4, bluez-hcidump

btdevicesmanager/po/Makefile.am

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
PLUGIN = BTDevicesManager
2-
LANGS = ca de el es fr it lt nl pl pt ru sk
3-
include $(top_srcdir)/Rules-po.mak
2+
CATEGORY ?= "Extensions"
3+
4+
include $(top_srcdir)/Rules_noxml-po.mak

btdevicesmanager/po/pl.po

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ msgstr ""
99
"Project-Id-Version: BTDevicesManager\n"
1010
"Report-Msgid-Bugs-To: \n"
1111
"POT-Creation-Date: 2025-03-29 20:16+0100\n"
12-
"PO-Revision-Date: 2025-03-30 13:40+0000\n"
12+
"PO-Revision-Date: 2025-11-11 15:41+0000\n"
1313
"Last-Translator: pololoko111\n"
1414
"Language-Team: \n"
1515
"Language: pl\n"
1616
"MIME-Version: 1.0\n"
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
19-
"X-Generator: Poedit 3.5\n"
19+
"X-Generator: Poedit 3.7\n"
2020

2121
msgid "Audio Connect"
2222
msgstr "Połączenie audio"
@@ -28,10 +28,10 @@ msgid "Audio On"
2828
msgstr "Dźwięk włączony"
2929

3030
msgid "Bluetooth Devices Manager"
31-
msgstr "Menadżer urządzeń Bluetooth"
31+
msgstr "Menedżer Bluetooth"
3232

3333
msgid "Bluetooth Devices Manager Setup"
34-
msgstr "Konfiguracja Menadżera urządzeń Bluetooth"
34+
msgstr "Konfiguracja Menedżera Bluetooth"
3535

3636
msgid "Can't not pair with selected device!"
3737
msgstr "Nie można sparować z wybranym urządzeniem!"
@@ -73,7 +73,7 @@ msgid "Scanning for devices..."
7373
msgstr "Skanowanie urządzeń..."
7474

7575
msgid "This is bt devices manager"
76-
msgstr "To jest menadżer urządzeń BT"
76+
msgstr "Menedżer urządzeń Bluetooth"
7777

7878
msgid "Trying to pair with:"
7979
msgstr "Próba sparowania z:"

btdevicesmanager/src/BTAudioConnect

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ if [ -n "$1" ]; then
8383
bluetooth_asoundconf "$bluetoothaddr" "$bluetoothname"
8484

8585
log "Starting audio streaming to Bluetooth device"
86-
arecord -q -f dat -t raw | aplay -q -f dat -t raw -D bluetooth --process-id-file /var/run/aplay.pid &
86+
arecord -q -f dat -t raw | aplay -q -f dat --buffer-size=16384 --period-size=2048 -t raw -D bluetooth --process-id-file /var/run/aplay.pid &
8787
else
8888
log "No Bluetooth address provided, exiting"
8989
fi

btdevicesmanager/src/plugin.py

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,32 @@
4545
config.btdevicesmanager.audioaddress = ConfigText(default="", fixed_size=False)
4646

4747

48+
def applyBTAudioState():
49+
if not isfile("/proc/stb/audio/btaudio"):
50+
return
51+
52+
newState = "off"
53+
if config.btdevicesmanager.audioaddress.value and config.av.btaudio.value:
54+
newState = "on"
55+
56+
print(f"[BluetoothManager] newState: {newState}")
57+
config.btdevicesmanager.audioaddress.save()
58+
config.btdevicesmanager.audioconnect.save()
59+
if hasattr(config, "av") and hasattr(config.av, "btaudio"):
60+
config.av.btaudio.save()
61+
62+
try:
63+
with open("/proc/stb/audio/btaudio", "w") as fn:
64+
fn.write(newState)
65+
except Exception as e:
66+
print(f"[BluetoothManager] Error writing btaudio: {e}")
67+
68+
commandconnect = resolveFilename(SCOPE_CURRENT_PLUGIN, "Extensions/BTDevicesManager/BTAudioConnect")
69+
audioaddress = config.btdevicesmanager.audioaddress.value
70+
audioaddress = f" {audioaddress}" if audioaddress and config.btdevicesmanager.audioconnect.value else ""
71+
system(f"{commandconnect}{audioaddress}")
72+
73+
4874
class BluetoothDevicesManagerSetup(Setup):
4975
def __init__(self, session):
5076
Setup.__init__(self, session, "BluetoothDevicesManager", plugin="Extensions/BTDevicesManager", PluginLanguageDomain="BTDevicesManager")
@@ -152,7 +178,7 @@ def readDeviceList(self):
152178
if self.devicelist:
153179
self["ConnStatus"].setText("")
154180
else:
155-
self["ConnStatus"].setText(_("No connected to any device"))
181+
self["ConnStatus"].setText(_("Not connected to any device"))
156182
self["devicelist"].setList(self.devicelist)
157183
self.selectionChanged()
158184

@@ -280,22 +306,19 @@ def keyBlue(self):
280306
if current[3] and isAudio:
281307
if config.btdevicesmanager.audioaddress.value == current[1]:
282308
config.btdevicesmanager.audioaddress.value = ""
309+
config.btdevicesmanager.audioconnect.value = False
310+
config.av.btaudio.value = False
283311
else:
284312
config.btdevicesmanager.audioaddress.value = current[1]
285-
config.btdevicesmanager.audioaddress.save()
286-
commandconnect = resolveFilename(SCOPE_CURRENT_PLUGIN, "Extensions/BTDevicesManager/BTAudioConnect")
287-
audioaddress = config.btdevicesmanager.audioaddress.value
288-
audioaddress = f" {audioaddress}" if audioaddress and config.btdevicesmanager.audioconnect.value else ""
289-
system(f"{commandconnect}{audioaddress}")
313+
config.btdevicesmanager.audioconnect.value = True
314+
config.av.btaudio.value = True
315+
applyBTAudioState()
290316
self.selectionChanged()
291317

292318
def keyMenu(self):
293319
if self.hasBTAudio:
294320
def setupCallback(*args):
295-
commandconnect = resolveFilename(SCOPE_CURRENT_PLUGIN, "Extensions/BTDevicesManager/BTAudioConnect")
296-
audioaddress = config.btdevicesmanager.audioaddress.value
297-
audioaddress = f" {audioaddress}" if audioaddress and config.btdevicesmanager.audioconnect.value else ""
298-
system(f"{commandconnect}{audioaddress}")
321+
applyBTAudioState()
299322
self.session.openWithCallback(setupCallback, BluetoothDevicesManagerSetup)
300323

301324
def setListOnView(self):
@@ -346,6 +369,7 @@ def sessionstart(session, reason, **kwargs):
346369
global iBluetoothDevicesTask
347370
if reason == 0:
348371
if isfile("/proc/stb/audio/btaudio"):
372+
applyBTAudioState()
349373
if iBluetoothDevicesTask is None:
350374
iBluetoothDevicesTask = BluetoothDevicesTask(session)
351375

test.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
for DIR in *; do
4+
if [ -d $DIR/src ]; then
5+
if [ -f $DIR/src/Makefile.am ]; then
6+
NAME=`grep installdir $DIR/src/Makefile.am`
7+
if [ -z "$NAME" ]; then
8+
NAME=`grep plugindir $DIR/src/Makefile.am`
9+
fi
10+
NAME=${NAME%/}
11+
echo mv $DIR ${NAME##*/}
12+
fi
13+
fi
14+
done

0 commit comments

Comments
 (0)