Skip to content

Commit

Permalink
Merge pull request #12 from cpcowart/master
Browse files Browse the repository at this point in the history
Fixing how the brightness attribute gets set.
  • Loading branch information
dcramer committed Nov 1, 2023
2 parents 8708b22 + c63d0d9 commit 6c5a100
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions custom_components/luxor/light.py
Expand Up @@ -5,8 +5,8 @@

from homeassistant.core import callback
from homeassistant.components.light import (
ColorMode,
LightEntity,
COLOR_MODE_BRIGHTNESS,
)
from homeassistant.exceptions import PlatformNotReady
from homeassistant.helpers.debounce import Debouncer
Expand Down Expand Up @@ -102,13 +102,16 @@ def brightness_to_intensity(brightness: int):


class LuxorLight(CoordinatorEntity, LightEntity):
supported_color_modes = {COLOR_MODE_BRIGHTNESS}

def __init__(self, coordinator, controller, group_id):
super().__init__(coordinator)
self.controller = controller
self.group_id = group_id
self._attr_unique_id = "LUXOR_LIGHT_{}".format(group_id)
color_mode = ColorMode.BRIGHTNESS
self._attr_color_mode = color_mode
self._attr_supported_color_modes = {color_mode}
self._attr_effect = None

async def async_turn_on(
self, brightness=255, **kwargs
Expand Down

0 comments on commit 6c5a100

Please sign in to comment.