-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: drive周りを大幅に作り直し
- Loading branch information
Showing
9 changed files
with
640 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from mipac.abstract.action import AbstractAction | ||
from mipac.http import HTTPClient, Route | ||
from mipac.models.drive import DriveStatus | ||
from mipac.types.drive import IDriveStatus | ||
|
||
if TYPE_CHECKING: | ||
from mipac.manager.client import ClientManager | ||
|
||
|
||
class DriveActions(AbstractAction): | ||
def __init__(self, *, session: HTTPClient, client: ClientManager): | ||
self.__session: HTTPClient = session | ||
self.__client: ClientManager = client | ||
|
||
async def get_status(self) -> DriveStatus: | ||
"""Get the status of the drive | ||
Returns | ||
------- | ||
DriveStatus | ||
The status of the drive | ||
""" | ||
|
||
res: IDriveStatus = await self.__session.request(Route("POST", "/api/drive"), auth=True) | ||
return DriveStatus(raw_drive_status=res, client=self.__client) |
Oops, something went wrong.