Skip to content

Commit 7227b1d

Browse files
feat : hibernate function added
1 parent 9baf775 commit 7227b1d

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,36 +214,40 @@ orangetool.hdmi_size(1280,720) # this function change hdmi display resolution
214214

215215
orangetool.sleep() # put system in sleep mode
216216

217-
#2- halt
217+
#2- hibernate
218+
219+
orangetool.hibernate() # put system in hibernate mode
220+
221+
#3- halt
218222

219223
orangetool.halt() # poweroff system
220224

221-
#3- restart
225+
#4- restart
222226

223227
orangetool.restart() # restart system
224228

225-
#4- wakeup
229+
#5- wakeup
226230

227231
orangetool.wakeup(day=1,hour=0,minute=1) # set rtc wakeuptime
228232

229-
#5- get_temp
233+
#6- get_temp
230234

231235
temp=orangetool.get_temp() # this function return cpu temperature as string
232236

233-
#6- uptime
237+
#7- uptime
234238

235239
time=orangetool.uptime() # this function return uptime of system
236240

237-
#7- idletime
241+
#8- idletime
238242

239243
time=orangetool.idletime() # this function return idle of system ( all cores)
240244

241245

242-
#8- version
246+
#9- version
243247

244248
orangetool.version() # return orangetool version for test
245249

246-
#9- check_update
250+
#10- check_update
247251

248252
orangetool.check_update() # Return True if new version is available
249253

@@ -255,7 +259,7 @@ orangetool.check_update() # Return True if new version is available
255259
- `local_ip` and `global_ip` originally are available in ipz package [Link](http://github.com/sepandhaghighi/ipz)
256260
- RAM functions in this version need psutil package
257261
- Running `set_ip` function remotely will freeze your terminal so it's better to set `restart` parameter to True
258-
- Running `halt`,`restart` & `sleep` functions remotely will freeze your terminal
262+
- Running `halt`,`restart`,`hibernate` & `sleep` functions remotely will freeze your terminal
259263
- Some of funtions need root access so it's better to run ```sudo -s``` before use this tool
260264

261265

orangetool/orangetool_system.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,16 @@ def sleep(DEBUG=False):
200200
"""
201201
power_control("pm-suspend", DEBUG)
202202

203+
def hibernate(DEBUG=False):
204+
"""
205+
Shortcut for hibernate command (need sudo).
206+
207+
:param DEBUG: flag for using Debug mode
208+
:type DEBUG:bool
209+
:return: None
210+
"""
211+
power_control("pm-hibernate", DEBUG)
212+
203213

204214
def halt(DEBUG=False):
205215
"""

0 commit comments

Comments
 (0)