1
0
mirror of https://github.com/natekspencer/hacs-oasis_mini.git synced 2025-12-06 18:44:14 -05:00

Formatting

This commit is contained in:
Nathan Spencer
2025-11-24 04:37:10 +00:00
parent 14223bd1c9
commit 04be6626a7
11 changed files with 61 additions and 62 deletions

View File

@@ -39,10 +39,10 @@ async def async_setup_entry(
def make_entities(new_devices: list[OasisDevice]):
"""
Create OasisDeviceLightEntity instances for each provided Oasis device.
Parameters:
new_devices (list[OasisDevice]): Devices to wrap as light entities.
Returns:
list[OasisDeviceLightEntity]: A list of light entity instances corresponding to the input devices.
"""
@@ -65,8 +65,8 @@ class OasisDeviceLightEntity(OasisDeviceEntity, LightEntity):
@property
def brightness(self) -> int:
"""
Get the light's brightness on a 0255 scale.
Get the light's brightness on a 0-255 scale.
Returns:
int: Brightness value between 0 and 255.
"""
@@ -120,19 +120,19 @@ class OasisDeviceLightEntity(OasisDeviceEntity, LightEntity):
async def async_turn_on(self, **kwargs: Any) -> None:
"""
Turn the light on and set its LED state.
Processes optional keyword arguments to compute the device-specific LED parameters, then updates the device's LEDs with the resulting brightness, color, and effect.
Parameters:
kwargs: Optional control parameters recognized by the method:
ATTR_BRIGHTNESS (int): Brightness in the 0255 Home Assistant scale. When provided,
ATTR_BRIGHTNESS (int): Brightness in the 0-255 Home Assistant scale. When provided,
it is converted and rounded up to the device's brightness scale (1..device.brightness_max).
When omitted, uses self.device.brightness or self.device.brightness_on.
ATTR_RGB_COLOR (tuple[int, int, int]): RGB tuple (R, G, B). When provided, it is
converted to a hex color string prefixed with '#'.
ATTR_EFFECT (str): Human-readable effect name. When provided, it is mapped to the
device's internal effect key; if no mapping exists, `None` is used.
Side effects:
Updates the underlying device LED state with the computed `brightness`, `color`, and `led_effect`.
"""
@@ -152,4 +152,4 @@ class OasisDeviceLightEntity(OasisDeviceEntity, LightEntity):
await self.device.async_set_led(
brightness=brightness, color=color, led_effect=led_effect
)
)