mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 06:37:52 +00:00
Break dependency on lutron component (#33031)
* Break dependency on lutron component * Fix isort complaint
This commit is contained in:
parent
3461f3a1ed
commit
f81464161a
@ -7,13 +7,22 @@ from homeassistant.components.light import (
|
|||||||
SUPPORT_BRIGHTNESS,
|
SUPPORT_BRIGHTNESS,
|
||||||
Light,
|
Light,
|
||||||
)
|
)
|
||||||
from homeassistant.components.lutron.light import to_hass_level, to_lutron_level
|
|
||||||
|
|
||||||
from . import LUTRON_CASETA_SMARTBRIDGE, LutronCasetaDevice
|
from . import LUTRON_CASETA_SMARTBRIDGE, LutronCasetaDevice
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def to_lutron_level(level):
|
||||||
|
"""Convert the given Home Assistant light level (0-255) to Lutron (0-100)."""
|
||||||
|
return int((level * 100) // 255)
|
||||||
|
|
||||||
|
|
||||||
|
def to_hass_level(level):
|
||||||
|
"""Convert the given Lutron (0-100) light level to Home Assistant (0-255)."""
|
||||||
|
return int((level * 255) // 100)
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
|
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
|
||||||
"""Set up the Lutron Caseta lights."""
|
"""Set up the Lutron Caseta lights."""
|
||||||
devs = []
|
devs = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user