@@ -69,6 +69,8 @@ def wrap(
69
69
** kwargs
70
70
):
71
71
""" Wrapper to create our schedule and run it at the appropriate time """
72
+ if interval == 0 :
73
+ return
72
74
scheduler = sched .scheduler (time .time , time .sleep )
73
75
periodic (scheduler , interval , func )
74
76
scheduler .run ()
@@ -79,83 +81,83 @@ def wrap(
79
81
80
82
81
83
@async_job ("CPU_Percentage" )
82
- @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['CPU' ]['PERCENTAGE' ].get ("INTERVAL" , None )).total_seconds ())
84
+ @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['CPU' ]['PERCENTAGE' ].get ("INTERVAL" , 0 )).total_seconds ())
83
85
def CPUPercentage ():
84
86
""" Refresh the CPU Percentage """
85
87
# logger.debug("Refresh CPU Percentage")
86
88
stats .CPU .percentage ()
87
89
88
90
89
91
@async_job ("CPU_Frequency" )
90
- @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['CPU' ]['FREQUENCY' ].get ("INTERVAL" , None )).total_seconds ())
92
+ @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['CPU' ]['FREQUENCY' ].get ("INTERVAL" , 0 )).total_seconds ())
91
93
def CPUFrequency ():
92
94
""" Refresh the CPU Frequency """
93
95
# logger.debug("Refresh CPU Frequency")
94
96
stats .CPU .frequency ()
95
97
96
98
97
99
@async_job ("CPU_Load" )
98
- @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['CPU' ]['LOAD' ].get ("INTERVAL" , None )).total_seconds ())
100
+ @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['CPU' ]['LOAD' ].get ("INTERVAL" , 0 )).total_seconds ())
99
101
def CPULoad ():
100
102
""" Refresh the CPU Load """
101
103
# logger.debug("Refresh CPU Load")
102
104
stats .CPU .load ()
103
105
104
106
105
107
@async_job ("CPU_Load" )
106
- @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['CPU' ]['TEMPERATURE' ].get ("INTERVAL" , None )).total_seconds ())
108
+ @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['CPU' ]['TEMPERATURE' ].get ("INTERVAL" , 0 )).total_seconds ())
107
109
def CPUTemperature ():
108
110
""" Refresh the CPU Temperature """
109
111
# logger.debug("Refresh CPU Temperature")
110
112
stats .CPU .temperature ()
111
113
112
114
113
115
@async_job ("CPU_FanSpeed" )
114
- @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['CPU' ]['FAN_SPEED' ].get ("INTERVAL" , None )).total_seconds ())
116
+ @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['CPU' ]['FAN_SPEED' ].get ("INTERVAL" , 0 )).total_seconds ())
115
117
def CPUFanSpeed ():
116
118
""" Refresh the CPU Fan Speed """
117
119
# logger.debug("Refresh CPU Fan Speed")
118
120
stats .CPU .fan_speed ()
119
121
120
122
121
123
@async_job ("GPU_Stats" )
122
- @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['GPU' ].get ("INTERVAL" , None )).total_seconds ())
124
+ @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['GPU' ].get ("INTERVAL" , 0 )).total_seconds ())
123
125
def GpuStats ():
124
126
""" Refresh the GPU Stats """
125
127
# logger.debug("Refresh GPU Stats")
126
128
stats .Gpu .stats ()
127
129
128
130
129
131
@async_job ("Memory_Stats" )
130
- @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['MEMORY' ].get ("INTERVAL" , None )).total_seconds ())
132
+ @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['MEMORY' ].get ("INTERVAL" , 0 )).total_seconds ())
131
133
def MemoryStats ():
132
134
# logger.debug("Refresh memory stats")
133
135
stats .Memory .stats ()
134
136
135
137
136
138
@async_job ("Disk_Stats" )
137
- @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['DISK' ].get ("INTERVAL" , None )).total_seconds ())
139
+ @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['DISK' ].get ("INTERVAL" , 0 )).total_seconds ())
138
140
def DiskStats ():
139
141
# logger.debug("Refresh disk stats")
140
142
stats .Disk .stats ()
141
143
142
144
143
145
@async_job ("Net_Stats" )
144
- @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['NET' ].get ("INTERVAL" , None )).total_seconds ())
146
+ @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['NET' ].get ("INTERVAL" , 0 )).total_seconds ())
145
147
def NetStats ():
146
148
# logger.debug("Refresh net stats")
147
149
stats .Net .stats ()
148
150
149
151
150
152
@async_job ("Date_Stats" )
151
- @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['DATE' ].get ("INTERVAL" , None )).total_seconds ())
153
+ @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['DATE' ].get ("INTERVAL" , 0 )).total_seconds ())
152
154
def DateStats ():
153
155
# logger.debug("Refresh date stats")
154
156
stats .Date .stats ()
155
157
156
158
157
159
@async_job ("Custom_Stats" )
158
- @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['CUSTOM' ].get ("INTERVAL" , None )).total_seconds ())
160
+ @schedule (timedelta (seconds = config .THEME_DATA ['STATS' ]['CUSTOM' ].get ("INTERVAL" , 0 )).total_seconds ())
159
161
def CustomStats ():
160
162
# print("Refresh custom stats")
161
163
stats .Custom .stats ()
0 commit comments