2022-09-11 10:33:12 +02:00
|
|
|
from abc import abstractmethod
|
|
|
|
|
from typing import Dict
|
|
|
|
|
|
2025-03-26 20:22:19 +01:00
|
|
|
from app.api.error_report.report import Report
|
|
|
|
|
from app.external.result_type.src.result.result import Err, Result
|
2024-02-20 19:56:11 +01:00
|
|
|
from app.system.models import (
|
|
|
|
|
ConnectionInfo,
|
|
|
|
|
LoginInput,
|
|
|
|
|
RawDebugLogData,
|
|
|
|
|
SystemInfo,
|
|
|
|
|
)
|
2022-09-11 10:33:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class SystemBase:
|
|
|
|
|
@abstractmethod
|
|
|
|
|
async def get_system_info(self) -> SystemInfo:
|
|
|
|
|
raise NotImplementedError()
|
|
|
|
|
|
|
|
|
|
@abstractmethod
|
|
|
|
|
async def shutdown(self, reboot: bool) -> bool:
|
|
|
|
|
raise NotImplementedError()
|
|
|
|
|
|
|
|
|
|
@abstractmethod
|
2025-03-26 20:22:19 +01:00
|
|
|
async def get_connection_info(self) -> Result[ConnectionInfo, Report]:
|
|
|
|
|
Err(Report("not implemented", error=NotImplementedError()))
|
2022-09-11 10:33:12 +02:00
|
|
|
|
|
|
|
|
@abstractmethod
|
2025-03-26 20:22:19 +01:00
|
|
|
async def login(self, i: LoginInput) -> Result[Dict[str, str], Report]:
|
|
|
|
|
Err(Report("not implemented", error=NotImplementedError()))
|
2022-09-11 10:33:12 +02:00
|
|
|
|
|
|
|
|
@abstractmethod
|
|
|
|
|
async def change_password(self, type: str, old_password: str, new_password: str):
|
|
|
|
|
raise NotImplementedError()
|
|
|
|
|
|
|
|
|
|
@abstractmethod
|
|
|
|
|
async def get_debug_logs_raw(self) -> RawDebugLogData:
|
|
|
|
|
raise NotImplementedError()
|
2022-10-03 20:22:00 +02:00
|
|
|
|
|
|
|
|
@abstractmethod
|
|
|
|
|
async def get_hardware_info(self) -> map:
|
|
|
|
|
raise NotImplementedError()
|
|
|
|
|
|
|
|
|
|
@abstractmethod
|
|
|
|
|
def get_hardware_info_yield_time(self) -> float:
|
|
|
|
|
raise NotImplementedError()
|