This commit is contained in:
Aron Petau 2026-01-01 15:27:25 +01:00
parent d596ed7e19
commit aa6626d80d
21 changed files with 1051 additions and 333 deletions

View file

@ -9,7 +9,7 @@ logger = logging.getLogger(__name__)
dotenv.load_dotenv() # Load environment variables from .env file
class StateManager:
def __init__(self, state_file: Path):
def __init__(self, state_file: Path) -> None:
self.state_file = state_file
self.logged_in = False # Initialize logged_in attribute
@ -27,12 +27,12 @@ class StateManager:
return json.load(f)
return {"autopilot": False}
def save_state(self, state: dict):
def save_state(self, state: dict) -> None:
"""Save persistent state"""
with open(self.state_file, "w") as f:
json.dump(state, f, indent=2)
def set_autopilot(self, enabled: bool):
def set_autopilot(self, enabled: bool) -> None:
"""Enable or disable autopilot mode"""
state = self.load_state()
state["autopilot"] = enabled
@ -43,7 +43,7 @@ class StateManager:
"""Check if autopilot mode is enabled"""
return self.load_state().get("autopilot", False)
def set_logged_in(self, status: bool):
def set_logged_in(self, status: bool) -> None:
"""Set the logged_in status"""
self.logged_in = status
logger.info(f"Logged in status set to: {status}")