mirror of
https://gitee.com/quecpython/helios-service.git
synced 2025-05-19 06:08:22 +08:00
20 lines
440 B
Python
20 lines
440 B
Python
from usr.bin.guard import GuardContext
|
|
|
|
# 刷新容器
|
|
guard_context = GuardContext()
|
|
guard_context.refresh()
|
|
|
|
# 获取pm低功耗服务
|
|
pm_ser = guard_context.get_server("pm")
|
|
# 投票不睡眠
|
|
pm_ser.lock()
|
|
pm_ser.lock()
|
|
pm_ser.lock()
|
|
# 释放投票进入休眠
|
|
pm_ser.unlock()
|
|
pm_ser.unlock()
|
|
pm_ser.unlock()
|
|
# 获取票数
|
|
pm_ser.count()
|
|
# 设置是否自动休眠, 默认是自动休眠, 1是自动休眠0则不是
|
|
pm_ser.auto_sleep(1) |