From 7936aaf147696c1a483982afb2a032500de6c541 Mon Sep 17 00:00:00 2001 From: Daniele Verducci Date: Fri, 26 Apr 2024 08:02:56 +0200 Subject: [PATCH] Convert tabs to spaces --- src/sensors_polling_timer.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/sensors_polling_timer.py b/src/sensors_polling_timer.py index cfbf260..ab81603 100644 --- a/src/sensors_polling_timer.py +++ b/src/sensors_polling_timer.py @@ -28,17 +28,17 @@ from threading import Timer # Instantiate it, then call run(interval_in_seconds, callback_function) # To stop it, call cancel() class SensorsPollingTimer(Timer): - def run(self): - # Setup - bus = Gio.bus_get_sync(Gio.BusType.SYSTEM, None) - self.proxy = Gio.DBusProxy.new_sync(bus,Gio.DBusProxyFlags.NONE,None,'net.hadess.SensorProxy','/net/hadess/SensorProxy','org.freedesktop.DBus.Properties', None) - self.oldValue = None + def run(self): + # Setup + bus = Gio.bus_get_sync(Gio.BusType.SYSTEM, None) + self.proxy = Gio.DBusProxy.new_sync(bus,Gio.DBusProxyFlags.NONE,None,'net.hadess.SensorProxy','/net/hadess/SensorProxy','org.freedesktop.DBus.Properties', None) + self.oldValue = None - # Loop - while not self.finished.wait(self.interval): - value = self.proxy.Get('(ss)', 'net.hadess.SensorProxy', 'LightLevel') - if (self.oldValue != value): - self.oldValue = value - unit = self.proxy.Get('(ss)', 'net.hadess.SensorProxy', 'LightLevelUnit') - self.function(value, unit) # Invoke callback + # Loop + while not self.finished.wait(self.interval): + value = self.proxy.Get('(ss)', 'net.hadess.SensorProxy', 'LightLevel') + if (self.oldValue != value): + self.oldValue = value + unit = self.proxy.Get('(ss)', 'net.hadess.SensorProxy', 'LightLevelUnit') + self.function(value, unit) # Invoke callback