Use port instead of url and fix PEP257 issues (#4192)

pull/4209/head
Fabian Affolter 2016-11-04 02:43:42 +01:00 committed by Paulus Schoutsen
parent d7b3c9c38e
commit 61a0976752
4 changed files with 15 additions and 13 deletions

View File

@ -4,7 +4,6 @@ Support for LiteJet lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.litejet/
"""
import logging
import homeassistant.components.litejet as litejet
@ -18,7 +17,7 @@ _LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Setup lights for the LiteJet platform."""
"""Set up lights for the LiteJet platform."""
litejet_ = hass.data['litejet_system']
devices = []
@ -30,7 +29,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
class LiteJetLight(Light):
"""Represents a single LiteJet light."""
"""Representation of a single LiteJet light."""
def __init__(self, hass, lj, i, name):
"""Initialize a LiteJet light."""

View File

@ -4,24 +4,25 @@ For more details about this component, please refer to the documentation at
https://home-assistant.io/components/litejet/
"""
import logging
import voluptuous as vol
from homeassistant.helpers import discovery
from homeassistant.const import CONF_URL
from homeassistant.const import CONF_PORT
import homeassistant.helpers.config_validation as cv
DOMAIN = 'litejet'
REQUIREMENTS = ['pylitejet==0.1']
_LOGGER = logging.getLogger(__name__)
CONF_EXCLUDE_NAMES = 'exclude_names'
CONF_INCLUDE_SWITCHES = 'include_switches'
_LOGGER = logging.getLogger(__name__)
DOMAIN = 'litejet'
CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Required(CONF_URL): cv.string,
vol.Required(CONF_PORT): cv.string,
vol.Optional(CONF_EXCLUDE_NAMES): vol.All(cv.ensure_list, [cv.string]),
vol.Optional(CONF_INCLUDE_SWITCHES, default=False): cv.boolean
})
@ -32,7 +33,7 @@ def setup(hass, config):
"""Initialize the LiteJet component."""
from pylitejet import LiteJet
url = config[DOMAIN].get(CONF_URL)
url = config[DOMAIN].get(CONF_PORT)
hass.data['litejet_system'] = LiteJet(url)
hass.data['litejet_config'] = config[DOMAIN]

View File

@ -5,6 +5,7 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/scene.litejet/
"""
import logging
import homeassistant.components.litejet as litejet
from homeassistant.components.scene import Scene
@ -16,7 +17,7 @@ _LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Setup scenes for the LiteJet platform."""
"""Set up scenes for the LiteJet platform."""
litejet_ = hass.data['litejet_system']
devices = []
@ -28,7 +29,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
class LiteJetScene(Scene):
"""Represents a single LiteJet scene."""
"""Representation of a single LiteJet scene."""
def __init__(self, lj, i, name):
"""Initialize the scene."""

View File

@ -5,6 +5,7 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.litejet/
"""
import logging
import homeassistant.components.litejet as litejet
from homeassistant.components.switch import SwitchDevice
@ -16,7 +17,7 @@ _LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Setup the LiteJet switch platform."""
"""Set up the LiteJet switch platform."""
litejet_ = hass.data['litejet_system']
devices = []
@ -28,7 +29,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
class LiteJetSwitch(SwitchDevice):
"""Represents a single LiteJet switch."""
"""Representation of a single LiteJet switch."""
def __init__(self, hass, lj, i, name):
"""Initialize a LiteJet switch."""