Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Update light.py #34

Merged
merged 1 commit into from
Jun 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 27 additions & 13 deletions custom_components/dmx/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,32 @@

from homeassistant.const import (CONF_DEVICES, CONF_HOST, CONF_NAME, CONF_PORT,
CONF_TYPE, STATE_ON, STATE_OFF)
from homeassistant.components.light import (ATTR_BRIGHTNESS,
ATTR_HS_COLOR,
ATTR_TRANSITION,
ATTR_WHITE_VALUE,
ATTR_COLOR_TEMP,
Light,
PLATFORM_SCHEMA,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_WHITE_VALUE,
SUPPORT_TRANSITION,
SUPPORT_COLOR_TEMP)
try:
from homeassistant.components.light import (ATTR_BRIGHTNESS,
ATTR_HS_COLOR,
ATTR_TRANSITION,
ATTR_WHITE_VALUE,
ATTR_COLOR_TEMP,
LightEntity,
PLATFORM_SCHEMA,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_WHITE_VALUE,
SUPPORT_TRANSITION,
SUPPORT_COLOR_TEMP)
except ImportError:
from homeassistant.components.light import (ATTR_BRIGHTNESS,
ATTR_HS_COLOR,
ATTR_TRANSITION,
ATTR_WHITE_VALUE,
ATTR_COLOR_TEMP,
Light as LightEntity,
PLATFORM_SCHEMA,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_WHITE_VALUE,
SUPPORT_TRANSITION,
SUPPORT_COLOR_TEMP)
from homeassistant.util.color import color_rgb_to_rgbw
import homeassistant.helpers.config_validation as cv
import homeassistant.util.color as color_util
Expand Down Expand Up @@ -167,7 +181,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
return True


class DMXLight(Light):
class DMXLight(LightEntity):
"""Representation of a DMX Art-Net light."""

def __init__(self, light, dmx_gateway, send_immediately, default_type):
Expand Down