mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
Fix: Timezone awareness of handle_night_commission
This commit is contained in:
parent
37fadc978f
commit
31fc6b5e1f
@ -1,4 +1,4 @@
|
|||||||
from datetime import datetime, time
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
from module.device.app import AppControl
|
from module.device.app import AppControl
|
||||||
from module.device.control import Control
|
from module.device.control import Control
|
||||||
@ -19,10 +19,11 @@ class Device(Screenshot, Control, AppControl):
|
|||||||
Returns:
|
Returns:
|
||||||
bool: If handled.
|
bool: If handled.
|
||||||
"""
|
"""
|
||||||
|
update = self.config.get_server_last_update(since=(hour,))
|
||||||
now = datetime.now().time()
|
now = datetime.now().time()
|
||||||
if now < time(hour - 1, 59, 60 - threshold):
|
if now < (update - timedelta(seconds=threshold)).time():
|
||||||
return False
|
return False
|
||||||
if now > time(hour, 0, threshold):
|
if now > (update + timedelta(seconds=threshold)).time():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if GET_MISSION.match(self.image, offset=True):
|
if GET_MISSION.match(self.image, offset=True):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user