diff --git a/bluedo/bluedoapp.py b/bluedo/bluedoapp.py index f94e921..f1ca15f 100644 --- a/bluedo/bluedoapp.py +++ b/bluedo/bluedoapp.py @@ -21,7 +21,7 @@ class BlueDo(Gtk.Application): project_name = 'bluedo' - project_version = 2.3 + project_version = 2.4 config_path = appdirs.user_config_dir(project_name) + '/' + project_name + '.ini' config_section = 'CONFIG' run_path = os.path.dirname(os.path.realpath(__file__)) + '/' @@ -615,6 +615,8 @@ def bluetooth_ping(self, here_callback, away_callback): syslog.syslog("No connection") if lost_pings > 0: syslog.syslog("Lost %s" % lost_pings) + if lost_pings%5 == 0: + attempt_bluetooth_connection(self.bt_address) if self.enabled: lost_pings += 1 @@ -674,6 +676,11 @@ def away_callback(self): # Static functions # +def attempt_bluetooth_connection(device): + """ Sometimes ubuntu seems to not reconnect automatically. """ + syslog.syslog("Attempting to start a bluetooth connection.") + subprocess.run(f"/usr/bin/bluetoothctl connect {device} > /dev/null", shell=True, check=False) + def run_user_command(cmd=''): ''' Run user supplied command ''' syslog.syslog("Running user command <%s>." % cmd) diff --git a/debian/changelog b/debian/changelog index 027c01e..97e9d19 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +bluedo (2.4) unstable; urgency=medium + + * Reach out to bluetooth device if not connected. + + -- Lars Falk-Petersen Sun, 09 Jul 2023 00:00:00 +0200 + bluedo (2.1) unstable; urgency=medium * Clear viewport before replacing demo animation with static picture. Minimum gtk 3.22. Move settings link to look OK when using large font. Other small changes. diff --git a/debian/copyright b/debian/copyright index 9b95250..96a430a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -2,5 +2,5 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Source: https://github.com/ways/BlueDo/blob/master/LICENSE Files: * -Copyright: 2020-2022 Lars Falk-Petersen +Copyright: 2020-2023 Lars Falk-Petersen License: GPL-3+ diff --git a/setup.py b/setup.py index d1ffb82..35591da 100644 --- a/setup.py +++ b/setup.py @@ -46,6 +46,7 @@ # Specify the Python versions you support here. 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', "Topic :: Desktop Environment", "Topic :: Desktop Environment :: Gnome", "Topic :: Security",