diff --git a/homeassistant/components/plum_lightpad/__init__.py b/homeassistant/components/plum_lightpad/__init__.py index bfdf67a0f40..a995d1a816a 100644 --- a/homeassistant/components/plum_lightpad/__init__.py +++ b/homeassistant/components/plum_lightpad/__init__.py @@ -10,9 +10,9 @@ from homeassistant.helpers import discovery from homeassistant.helpers.aiohttp_client import async_get_clientsession import homeassistant.helpers.config_validation as cv -_LOGGER = logging.getLogger(__name__) +from .const import DOMAIN -DOMAIN = "plum_lightpad" +_LOGGER = logging.getLogger(__name__) CONFIG_SCHEMA = vol.Schema( { @@ -26,8 +26,6 @@ CONFIG_SCHEMA = vol.Schema( extra=vol.ALLOW_EXTRA, ) -PLUM_DATA = "plum" - async def async_setup(hass, config): """Plum Lightpad Platform initialization.""" @@ -35,7 +33,7 @@ async def async_setup(hass, config): conf = config[DOMAIN] plum = Plum(conf[CONF_USERNAME], conf[CONF_PASSWORD]) - hass.data[PLUM_DATA] = plum + hass.data[DOMAIN] = plum def cleanup(event): """Clean up resources.""" diff --git a/homeassistant/components/plum_lightpad/const.py b/homeassistant/components/plum_lightpad/const.py new file mode 100644 index 00000000000..efea35d0a7a --- /dev/null +++ b/homeassistant/components/plum_lightpad/const.py @@ -0,0 +1,3 @@ +"""Constants for the Plum Lightpad component.""" + +DOMAIN = "plum_lightpad" diff --git a/homeassistant/components/plum_lightpad/light.py b/homeassistant/components/plum_lightpad/light.py index 2fea14474bb..0dffa4c966c 100644 --- a/homeassistant/components/plum_lightpad/light.py +++ b/homeassistant/components/plum_lightpad/light.py @@ -8,7 +8,7 @@ from homeassistant.components.light import ( ) import homeassistant.util.color as color_util -from . import PLUM_DATA +from .const import DOMAIN async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): @@ -16,7 +16,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= if discovery_info is None: return - plum = hass.data[PLUM_DATA] + plum = hass.data[DOMAIN] entities = []