Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions resources/lib/dbus_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@ def manager_unregister_agent(self):
pass


class Bool(int):

def __new__(cls, value):
return int.__new__(cls, bool(value))

def __str__(self):
return '1' if self == True else '0'


class LoopThread(threading.Thread):

def __init__(self, loop):
Expand Down Expand Up @@ -92,7 +83,7 @@ def list_names():

def convert_from_dbussy(data):
if isinstance(data, bool):
return Bool(data)
return str(int(data))
if isinstance(data, dict):
return {key: convert_from_dbussy(data[key]) for key in data.keys()}
if isinstance(data, list):
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/modules/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def load_values(self):
value = oe.read_setting('bluetooth', 'idle_timeout')
if not value:
value = '0'
self.struct['bluez']['settings']['idle_timeout']['value'] = oe.read_setting('bluetooth', 'idle_timeout')
self.struct['bluez']['settings']['idle_timeout']['value'] = value
else:
self.struct['bluez']['hidden'] = 'true'

Expand Down
4 changes: 4 additions & 0 deletions service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Copyright (C) 2013 Lutz Fiebach ([email protected])
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)

import gc
import syspath
import dbus_utils
import oe
Expand Down Expand Up @@ -104,6 +105,9 @@ def run(self):
oe.stop_service()
service_thread.stop()
dbus_utils.LOOP_THREAD.stop()
# call garbage collection to workaround a crash on shutdown
del dbus_utils.BUS
gc.collect()


if __name__ == '__main__':
Expand Down