Skip to content

Commit

Permalink
Merge pull request #22 from zilvinasbin/feature/ligth-updates
Browse files Browse the repository at this point in the history
feat: update dimmers
  • Loading branch information
zilvinasbin authored Dec 8, 2024
2 parents dcea4bc + 6f0cd35 commit 769c2fd
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions custom_components/domintell/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import asyncio
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv

# Import the device class from the component that you want to support
from homeassistant.components.light import ATTR_BRIGHTNESS, LightEntity, PLATFORM_SCHEMA, SUPPORT_BRIGHTNESS
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD, CONF_DEVICES, CONF_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.components.light import ATTR_BRIGHTNESS, LightEntity, PLATFORM_SCHEMA, ColorMode
from homeassistant.const import CONF_DEVICES, CONF_NAME

from .const import (DOMAIN)

Expand Down Expand Up @@ -140,9 +140,14 @@ def _on_message(self, message):
def brightness(self):
return int(self._brightness * 255 / 100)


@property
def supported_color_modes(self):
return {ColorMode.BRIGHTNESS}

@property
def supported_features(self):
return SUPPORT_BRIGHTNESS
def color_mode(self):
return ColorMode.BRIGHTNESS

def turn_on(self, **kwargs):
"""Instruct the light to turn on."""
Expand Down

0 comments on commit 769c2fd

Please sign in to comment.