StarRailCopilot/module/device/app.py
LmeSzinc ae94260ff8 Add: 支持App控制, 支持自动登录
- 修复了12-4地图信息的错误
2020-04-10 14:18:10 +08:00

20 lines
598 B
Python

from module.device.connection import Connection
from module.logger import logger
class AppControl(Connection):
def app_is_running(self):
app = self.device.app_current()
package = app['package']
logger.attr('Package_name', package)
return package == self.config.PACKAGE_NAME
def app_stop(self):
logger.info(f'App stop: {self.config.PACKAGE_NAME}')
self.device.app_stop(self.config.PACKAGE_NAME)
def app_start(self):
logger.info(f'App start: {self.config.PACKAGE_NAME}')
self.device.app_start(self.config.PACKAGE_NAME)