from homeassistant.helpers import config_validation as cv from custom_components import NooLite from custom_components.NooLite import PLATFORM_SCHEMA from custom_components.NooLite import CONF_CHANNEL DEPENDENCIES = ['NooLite'] _LOGGER = logging.getLogger(__name__) TYPES = ['Motion', 'Remote'] PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Optional(CONF_TYPE, 'Motion'): vol.In(TYPES), vol.Required(CONF_NAME): cv.string, vol.Required(CONF_CHANNEL): cv.positive_int, vol.Required(CONF_MODE): cv.string, }) def setup_platform(hass, config, add_devices, discovery_info=None): """Setup the NooLite platform.""" _LOGGER.info(config) module_type = config.get(CONF_TYPE) devices = [] if module_type == 'Motion': devices.append(NooLiteMotionSensor(config)) elif module_type == 'Remote': devices.append(NooLiteBinarySensor(config, 'power'))
from custom_components.NooLite import PLATFORM_SCHEMA from custom_components.NooLite import CONF_CHANNEL, CONF_NAME from custom_components import NooLite DEPENDENCIES = ['NooLite'] _LOGGER = logging.getLogger(__name__) TYPES = ['TempHumi', 'Temp', 'Analog'] MEASUREMENT_PERCENTS = "%" PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Required(CONF_TYPE): vol.In(TYPES), }) def setup_platform(hass, config, add_devices, discovery_info=None): """Setup the NooLite platform.""" _LOGGER.info(config) module_type = config.get(CONF_TYPE) devices = [] if module_type == 'TempHumi': devices.append(NooLiteHumiSensor(hass, config)) devices.append(NooLiteTempSensor(hass, config)) elif module_type == 'Temp': devices.append(NooLiteTempSensor(hass, config))
from homeassistant.helpers import config_validation as cv from homeassistant.const import CONF_TYPE from homeassistant.components.light import Light from custom_components.NooLite import PLATFORM_SCHEMA from custom_components.NooLite import NooLiteModule, NooLiteDimmerModule, NooLiteRGBLedModule from custom_components.NooLite import CONF_BROADCAST DEPENDENCIES = ['NooLite'] _LOGGER = logging.getLogger(__name__) TYPES = ['Light', 'Dimmer', 'RGBLed'] PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Optional(CONF_TYPE, default='Light'): vol.In(TYPES), vol.Optional(CONF_BROADCAST, default=False): cv.boolean, }) def setup_platform(hass, config, add_devices, discovery_info=None): """Setup the NooLite platform.""" _LOGGER.info(config) module_type = config.get(CONF_TYPE) device = None if module_type == 'Dimmer': device = NooLiteDimmerSwitch(hass, config) elif module_type == 'RGBLed': device = NooLiteRGBLedSwitch(hass, config)
from custom_components.NooLite import PLATFORM_SCHEMA from custom_components.NooLite import NooLiteModule, NooLiteDimmerModule, NooLiteRGBLedModule from custom_components.NooLite import CONF_BROADCAST, CONF_CHANNEL DEPENDENCIES = ['NooLite'] _LOGGER = logging.getLogger(__name__) TYPES = ['Light', 'Dimmer', 'RGBLed'] PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Optional(CONF_TYPE, default='Light'): vol.In(TYPES), vol.Optional(CONF_BROADCAST, default=False): cv.boolean, vol.Required(CONF_NAME): cv.string, vol.Required(CONF_CHANNEL): cv.positive_int, vol.Required(CONF_MODE): cv.string, }) def setup_platform(hass, config, add_devices, discovery_info=None): """Setup the NooLite platform.""" _LOGGER.info(config) module_type = config.get(CONF_TYPE) device = None if module_type == 'Dimmer':
from homeassistant.const import CONF_TYPE from homeassistant.components.binary_sensor import BinarySensorDevice from custom_components.NooLite import PLATFORM_SCHEMA from custom_components.NooLite import CONF_CHANNEL, CONF_NAME from custom_components import NooLite DEPENDENCIES = ['NooLite'] _LOGGER = logging.getLogger(__name__) TYPES = ['Motion'] PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Optional(CONF_TYPE, 'Motion'): vol.In(TYPES), }) def setup_platform(hass, config, add_devices, discovery_info=None): """Setup the NooLite platform.""" _LOGGER.info(config) module_type = config.get(CONF_TYPE) devices = [] if module_type == 'Motion': devices.append(NooLiteMotionSensor(config, 'motion')) add_devices(devices)