Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

监测自己能量时屏幕自动息屏 #29

Closed
Johnson-W opened this issue May 16, 2019 · 2 comments
Closed

监测自己能量时屏幕自动息屏 #29

Johnson-W opened this issue May 16, 2019 · 2 comments
Labels
Bug 🐞 故障 Confirmed bugs or reports that are very likely to be bugs Obsolete 🕳️ 远古 Issue creater doesn't provide more specific information within a long time (often one month) Proposal 💡 方案 Issue creater's own proposal which may be really helpful Reinforcement ✨ 强化 Issues for higher quality of being compatible

Comments

@Johnson-W
Copy link

如果手机自动息屏时间比较短,但是监测自己能量设置的时间比较长,会出现屏幕息屏,再之后手机自动锁定,收取自己能量就失败了。
改了下脚本,这一行
while (new Date() < max_time) ~sleep(180) && check();
改成
while (new Date() < max_time) { sleep(180); device.wakeUp(); check(); }
加了个点亮屏幕,这样就不会息屏收取失败了

@SuperMonster003
Copy link
Owner

感谢反馈 近期会修复这个问题 (不迟于22日)
另外也可以考虑使用 device.keepScreenOn(timeout)device.keepScreenDim(timeout)
需要加入timeout作为保险 否则一旦在 device.cancelKeepingAwake() 执行之前 代码出错停止
很可能造成手机无法自动关闭屏幕的问题 (需强制关闭Auto.js)
所以一定要加入timeout
device.wakeUp() 虽然180ms时间很短 但还是可能出现手机出现非常短暂的黑屏几率
可以用 sleep(5000) 测试就会发现 手机还是有概率会息屏的

@SuperMonster003
Copy link
Owner

目前已加入监测自己能量时屏幕常亮 并在监测结束后解除常亮的方法 此Issue暂时关闭 如发现功能异常 欢迎随时反馈

@SuperMonster003 SuperMonster003 added Reinforcement ✨ 强化 Issues for higher quality of being compatible Bug 🐞 故障 Confirmed bugs or reports that are very likely to be bugs Obsolete 🕳️ 远古 Issue creater doesn't provide more specific information within a long time (often one month) Proposal 💡 方案 Issue creater's own proposal which may be really helpful labels Nov 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐞 故障 Confirmed bugs or reports that are very likely to be bugs Obsolete 🕳️ 远古 Issue creater doesn't provide more specific information within a long time (often one month) Proposal 💡 方案 Issue creater's own proposal which may be really helpful Reinforcement ✨ 强化 Issues for higher quality of being compatible
Projects
None yet
Development

No branches or pull requests

2 participants