mirror of
https://github.com/natekspencer/hacs-oasis_mini.git
synced 2025-12-06 18:44:14 -05:00
Fix formatting in transport.py
This commit is contained in:
@@ -14,7 +14,8 @@ class OasisClientProtocol(Protocol):
|
|||||||
- HTTP client (direct LAN)
|
- HTTP client (direct LAN)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
async def async_get_mac_address(self, device: OasisDevice) -> str | None: """
|
async def async_get_mac_address(self, device: OasisDevice) -> str | None:
|
||||||
|
"""
|
||||||
Retrieve the MAC address of the specified Oasis device.
|
Retrieve the MAC address of the specified Oasis device.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
@@ -23,31 +24,30 @@ Parameters:
|
|||||||
Returns:
|
Returns:
|
||||||
str | None: The device's MAC address as a string, or `None` if the MAC address is unavailable.
|
str | None: The device's MAC address as a string, or `None` if the MAC address is unavailable.
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
|
|
||||||
async def async_send_auto_clean_command(
|
async def async_send_auto_clean_command(
|
||||||
self, device: OasisDevice, auto_clean: bool
|
self, device: OasisDevice, auto_clean: bool
|
||||||
) -> None: """
|
) -> None:
|
||||||
|
"""
|
||||||
Enable or disable the device's auto-clean mode.
|
Enable or disable the device's auto-clean mode.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
device (OasisDevice): The target Oasis device to send the command to.
|
device (OasisDevice): The target Oasis device to send the command to.
|
||||||
auto_clean (bool): `True` to enable auto-clean mode, `False` to disable it.
|
auto_clean (bool): `True` to enable auto-clean mode, `False` to disable it.
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
|
|
||||||
async def async_send_ball_speed_command(
|
async def async_send_ball_speed_command(
|
||||||
self,
|
self,
|
||||||
device: OasisDevice,
|
device: OasisDevice,
|
||||||
speed: int,
|
speed: int,
|
||||||
) -> None: """
|
) -> None:
|
||||||
|
"""
|
||||||
Set the device's ball speed to the specified value.
|
Set the device's ball speed to the specified value.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
device (OasisDevice): Target Oasis device to send the command to.
|
device (OasisDevice): Target Oasis device to send the command to.
|
||||||
speed (int): Desired ball speed value for the device.
|
speed (int): Desired ball speed value for the device.
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
|
|
||||||
async def async_send_led_command(
|
async def async_send_led_command(
|
||||||
self,
|
self,
|
||||||
@@ -56,7 +56,8 @@ Returns:
|
|||||||
color: str,
|
color: str,
|
||||||
led_speed: int,
|
led_speed: int,
|
||||||
brightness: int,
|
brightness: int,
|
||||||
) -> None: """
|
) -> None:
|
||||||
|
"""
|
||||||
Configure the device's LED effect, color, speed, and brightness.
|
Configure the device's LED effect, color, speed, and brightness.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
@@ -66,22 +67,22 @@ Returns:
|
|||||||
led_speed (int): Effect speed; larger values increase the animation speed.
|
led_speed (int): Effect speed; larger values increase the animation speed.
|
||||||
brightness (int): Brightness level as a percentage from 0 to 100.
|
brightness (int): Brightness level as a percentage from 0 to 100.
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
|
|
||||||
async def async_send_sleep_command(self, device: OasisDevice) -> None: """
|
async def async_send_sleep_command(self, device: OasisDevice) -> None:
|
||||||
|
"""
|
||||||
Put the specified Oasis device into sleep mode.
|
Put the specified Oasis device into sleep mode.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
device (OasisDevice): The target Oasis device to send the sleep command to.
|
device (OasisDevice): The target Oasis device to send the sleep command to.
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
|
|
||||||
async def async_send_move_job_command(
|
async def async_send_move_job_command(
|
||||||
self,
|
self,
|
||||||
device: OasisDevice,
|
device: OasisDevice,
|
||||||
from_index: int,
|
from_index: int,
|
||||||
to_index: int,
|
to_index: int,
|
||||||
) -> None: """
|
) -> None:
|
||||||
|
"""
|
||||||
Move a job within the device's job list from one index to another.
|
Move a job within the device's job list from one index to another.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
@@ -89,77 +90,77 @@ Parameters:
|
|||||||
from_index (int): Source index of the job in the device's job list.
|
from_index (int): Source index of the job in the device's job list.
|
||||||
to_index (int): Destination index to move the job to.
|
to_index (int): Destination index to move the job to.
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
|
|
||||||
async def async_send_change_track_command(
|
async def async_send_change_track_command(
|
||||||
self,
|
self,
|
||||||
device: OasisDevice,
|
device: OasisDevice,
|
||||||
index: int,
|
index: int,
|
||||||
) -> None: """
|
) -> None:
|
||||||
|
"""
|
||||||
Change the device's current track to the specified track index.
|
Change the device's current track to the specified track index.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
device (OasisDevice): The target Oasis device to receive the command.
|
device (OasisDevice): The target Oasis device to receive the command.
|
||||||
index (int): The index of the track to select on the device.
|
index (int): The index of the track to select on the device.
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
|
|
||||||
async def async_send_add_joblist_command(
|
async def async_send_add_joblist_command(
|
||||||
self,
|
self,
|
||||||
device: OasisDevice,
|
device: OasisDevice,
|
||||||
tracks: list[int],
|
tracks: list[int],
|
||||||
) -> None: """
|
) -> None:
|
||||||
|
"""
|
||||||
Add the given sequence of track indices to the device's job list.
|
Add the given sequence of track indices to the device's job list.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
device (OasisDevice): Target Oasis device to receive the new jobs.
|
device (OasisDevice): Target Oasis device to receive the new jobs.
|
||||||
tracks (list[int]): Ordered list of track indices to append to the device's job list.
|
tracks (list[int]): Ordered list of track indices to append to the device's job list.
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
|
|
||||||
async def async_send_set_playlist_command(
|
async def async_send_set_playlist_command(
|
||||||
self,
|
self,
|
||||||
device: OasisDevice,
|
device: OasisDevice,
|
||||||
playlist: list[int],
|
playlist: list[int],
|
||||||
) -> None: """
|
) -> None:
|
||||||
|
"""
|
||||||
Set the device's current playlist to the provided sequence of track indices.
|
Set the device's current playlist to the provided sequence of track indices.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
device (OasisDevice): The target Oasis device to receive the playlist.
|
device (OasisDevice): The target Oasis device to receive the playlist.
|
||||||
playlist (list[int]): Sequence of track indices in the desired playback order.
|
playlist (list[int]): Sequence of track indices in the desired playback order.
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
|
|
||||||
async def async_send_set_repeat_playlist_command(
|
async def async_send_set_repeat_playlist_command(
|
||||||
self,
|
self,
|
||||||
device: OasisDevice,
|
device: OasisDevice,
|
||||||
repeat: bool,
|
repeat: bool,
|
||||||
) -> None: """
|
) -> None:
|
||||||
|
"""
|
||||||
Set whether the device should repeat the current playlist.
|
Set whether the device should repeat the current playlist.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
repeat (bool): True to enable repeating the current playlist, False to disable it.
|
repeat (bool): True to enable repeating the current playlist, False to disable it.
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
|
|
||||||
async def async_send_set_autoplay_command(
|
async def async_send_set_autoplay_command(
|
||||||
self,
|
self,
|
||||||
device: OasisDevice,
|
device: OasisDevice,
|
||||||
option: str,
|
option: str,
|
||||||
) -> None: """
|
) -> None:
|
||||||
|
"""
|
||||||
Send a command to configure the device's autoplay behavior.
|
Send a command to configure the device's autoplay behavior.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
device (OasisDevice): Target Oasis device to receive the command.
|
device (OasisDevice): Target Oasis device to receive the command.
|
||||||
option (str): Autoplay option to set (e.g., "on", "off", "shuffle", or other device-supported mode).
|
option (str): Autoplay option to set (e.g., "on", "off", "shuffle", or other device-supported mode).
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
|
|
||||||
async def async_send_upgrade_command(
|
async def async_send_upgrade_command(
|
||||||
self,
|
self,
|
||||||
device: OasisDevice,
|
device: OasisDevice,
|
||||||
beta: bool,
|
beta: bool,
|
||||||
) -> None: """
|
) -> None:
|
||||||
|
"""
|
||||||
Initiates a firmware upgrade on the given Oasis device.
|
Initiates a firmware upgrade on the given Oasis device.
|
||||||
|
|
||||||
If `beta` is True, requests the device to use the beta upgrade channel; otherwise requests the stable channel.
|
If `beta` is True, requests the device to use the beta upgrade channel; otherwise requests the stable channel.
|
||||||
@@ -168,40 +169,40 @@ Parameters:
|
|||||||
device (OasisDevice): Target device to upgrade.
|
device (OasisDevice): Target device to upgrade.
|
||||||
beta (bool): Whether to use the beta upgrade channel (`True`) or the stable channel (`False`).
|
beta (bool): Whether to use the beta upgrade channel (`True`) or the stable channel (`False`).
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
|
|
||||||
async def async_send_play_command(self, device: OasisDevice) -> None: """
|
async def async_send_play_command(self, device: OasisDevice) -> None:
|
||||||
|
"""
|
||||||
Send a play command to the specified Oasis device.
|
Send a play command to the specified Oasis device.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
device (OasisDevice): The target device to instruct to start playback.
|
device (OasisDevice): The target device to instruct to start playback.
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
|
|
||||||
async def async_send_pause_command(self, device: OasisDevice) -> None: """
|
async def async_send_pause_command(self, device: OasisDevice) -> None:
|
||||||
|
"""
|
||||||
Pause playback on the specified Oasis device.
|
Pause playback on the specified Oasis device.
|
||||||
|
|
||||||
This sends a pause command to the device so it stops current playback.
|
This sends a pause command to the device so it stops current playback.
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
|
|
||||||
async def async_send_stop_command(self, device: OasisDevice) -> None: """
|
async def async_send_stop_command(self, device: OasisDevice) -> None:
|
||||||
|
"""
|
||||||
Send a stop command to the specified Oasis device to halt playback.
|
Send a stop command to the specified Oasis device to halt playback.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
device (OasisDevice): The target Oasis device to receive the stop command.
|
device (OasisDevice): The target Oasis device to receive the stop command.
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
|
|
||||||
async def async_send_reboot_command(self, device: OasisDevice) -> None: """
|
async def async_send_reboot_command(self, device: OasisDevice) -> None:
|
||||||
|
"""
|
||||||
Send a reboot command to the specified Oasis device.
|
Send a reboot command to the specified Oasis device.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
device (OasisDevice): The target Oasis device to reboot.
|
device (OasisDevice): The target Oasis device to reboot.
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
|
|
||||||
async def async_get_all(self, device: OasisDevice) -> None: """
|
async def async_get_all(self, device: OasisDevice) -> None:
|
||||||
|
"""
|
||||||
Fetch comprehensive device data for the specified Oasis device.
|
Fetch comprehensive device data for the specified Oasis device.
|
||||||
|
|
||||||
This method triggers retrieval of all relevant information (configuration, status, and runtime data) for the given device so the client's representation of that device can be refreshed.
|
This method triggers retrieval of all relevant information (configuration, status, and runtime data) for the given device so the client's representation of that device can be refreshed.
|
||||||
@@ -209,9 +210,9 @@ This method triggers retrieval of all relevant information (configuration, statu
|
|||||||
Parameters:
|
Parameters:
|
||||||
device (OasisDevice): Target device whose data should be fetched and refreshed.
|
device (OasisDevice): Target device whose data should be fetched and refreshed.
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
|
|
||||||
async def async_get_status(self, device: OasisDevice) -> None: """
|
async def async_get_status(self, device: OasisDevice) -> None:
|
||||||
|
"""
|
||||||
Retrieve the current runtime status for the specified Oasis device.
|
Retrieve the current runtime status for the specified Oasis device.
|
||||||
|
|
||||||
Implementations should query the device for its current state (for example: playback, LED settings, job/track lists, and connectivity) and update any client-side representation or caches as needed.
|
Implementations should query the device for its current state (for example: playback, LED settings, job/track lists, and connectivity) and update any client-side representation or caches as needed.
|
||||||
@@ -219,4 +220,3 @@ Implementations should query the device for its current state (for example: play
|
|||||||
Parameters:
|
Parameters:
|
||||||
device (OasisDevice): The target device to query.
|
device (OasisDevice): The target device to query.
|
||||||
"""
|
"""
|
||||||
...
|
|
||||||
Reference in New Issue
Block a user