fix: Ruff

This commit is contained in:
墨梓柒
2025-04-30 09:40:45 +08:00
parent fbb17e4274
commit 42505960e1
2 changed files with 2 additions and 2 deletions

View File

@@ -192,7 +192,7 @@ class InterestMonitorApp:
main_mind_entries.sort(key=lambda x: x[0]) main_mind_entries.sort(key=lambda x: x[0])
recent_entries = main_mind_entries[-MAX_QUEUE_SIZE:] recent_entries = main_mind_entries[-MAX_QUEUE_SIZE:]
self.main_mind_history.clear() self.main_mind_history.clear()
for ts, entry in recent_entries: for _ts, entry in recent_entries:
self.main_mind_history.append(entry) self.main_mind_history.append(entry)
if recent_entries: if recent_entries:
self.last_main_mind_timestamp = recent_entries[-1][0] self.last_main_mind_timestamp = recent_entries[-1][0]

View File

@@ -144,7 +144,7 @@ class MaiStateManager:
# 辅助函数:根据 prevent_offline_state 标志调整目标状态 # 辅助函数:根据 prevent_offline_state 标志调整目标状态
def _resolve_offline(candidate_state: MaiState) -> MaiState: def _resolve_offline(candidate_state: MaiState) -> MaiState:
if prevent_offline_state and candidate_state == MaiState.OFFLINE: if prevent_offline_state and candidate_state == MaiState.OFFLINE:
logger.debug(f"阻止进入 OFFLINE改为 PEEKING") logger.debug("阻止进入 OFFLINE改为 PEEKING")
return MaiState.PEEKING return MaiState.PEEKING
return candidate_state return candidate_state