From 3db6a62804368a338a3872f04769d2bda6a9e9eb Mon Sep 17 00:00:00 2001 From: "Alireza |S.N|" Date: Sat, 13 Nov 2021 23:22:19 +0330 Subject: [PATCH] We need a main function for pypi :| --- bluetooth_battery.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bluetooth_battery.py b/bluetooth_battery.py index 1c68618..0005136 100755 --- a/bluetooth_battery.py +++ b/bluetooth_battery.py @@ -148,7 +148,7 @@ def _perform_query(self) -> int: return result -if __name__ == "__main__": +def main(): """ The starting point of the program. For each device address in the argument list a bluetooth socket will be opened and the battery level will be read @@ -161,3 +161,6 @@ def _perform_query(self) -> int: for device in args.devices: query = BatteryStateQuerier(*device.split(".")) print("Battery level for {} is {}".format(device, str(query))) + +if __name__ == "__main__": + main()