From e5969f0733d409fa1a1d43c45b20f3a22abc061f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 22 Aug 2016 14:20:04 +0200 Subject: [PATCH] Clean-up (#2933) --- homeassistant/components/lock/demo.py | 10 +++++----- homeassistant/components/lock/mqtt.py | 10 +++++----- homeassistant/components/lock/vera.py | 11 +++++------ 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/homeassistant/components/lock/demo.py b/homeassistant/components/lock/demo.py index 06366429e6c..55929227039 100644 --- a/homeassistant/components/lock/demo.py +++ b/homeassistant/components/lock/demo.py @@ -5,20 +5,20 @@ For more details about this platform, please refer to the documentation https://home-assistant.io/components/demo/ """ from homeassistant.components.lock import LockDevice -from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED +from homeassistant.const import (STATE_LOCKED, STATE_UNLOCKED) # pylint: disable=unused-argument -def setup_platform(hass, config, add_devices_callback, discovery_info=None): - """Setup the demo lock platform.""" - add_devices_callback([ +def setup_platform(hass, config, add_devices, discovery_info=None): + """Setup the Demo lock platform.""" + add_devices([ DemoLock('Front Door', STATE_LOCKED), DemoLock('Kitchen Door', STATE_UNLOCKED) ]) class DemoLock(LockDevice): - """Representation of a demo lock.""" + """Representation of a Demo lock.""" def __init__(self, name, state): """Initialize the lock.""" diff --git a/homeassistant/components/lock/mqtt.py b/homeassistant/components/lock/mqtt.py index b188de21edc..81ab179efd4 100644 --- a/homeassistant/components/lock/mqtt.py +++ b/homeassistant/components/lock/mqtt.py @@ -23,9 +23,9 @@ DEPENDENCIES = ['mqtt'] CONF_PAYLOAD_LOCK = 'payload_lock' CONF_PAYLOAD_UNLOCK = 'payload_unlock' -DEFAULT_NAME = "MQTT Lock" -DEFAULT_PAYLOAD_LOCK = "LOCK" -DEFAULT_PAYLOAD_UNLOCK = "UNLOCK" +DEFAULT_NAME = 'MQTT Lock' +DEFAULT_PAYLOAD_LOCK = 'LOCK' +DEFAULT_PAYLOAD_UNLOCK = 'UNLOCK' DEFAULT_OPTIMISTIC = False PLATFORM_SCHEMA = mqtt.MQTT_RW_PLATFORM_SCHEMA.extend({ @@ -39,9 +39,9 @@ PLATFORM_SCHEMA = mqtt.MQTT_RW_PLATFORM_SCHEMA.extend({ # pylint: disable=unused-argument -def setup_platform(hass, config, add_devices_callback, discovery_info=None): +def setup_platform(hass, config, add_devices, discovery_info=None): """Setup the MQTT lock.""" - add_devices_callback([MqttLock( + add_devices([MqttLock( hass, config[CONF_NAME], config.get(CONF_STATE_TOPIC), diff --git a/homeassistant/components/lock/vera.py b/homeassistant/components/lock/vera.py index 6ac8fb2c315..0307bbf4312 100644 --- a/homeassistant/components/lock/vera.py +++ b/homeassistant/components/lock/vera.py @@ -7,19 +7,18 @@ https://home-assistant.io/components/lock.vera/ import logging from homeassistant.components.lock import LockDevice -from homeassistant.const import ( - STATE_LOCKED, STATE_UNLOCKED) +from homeassistant.const import (STATE_LOCKED, STATE_UNLOCKED) from homeassistant.components.vera import ( VeraDevice, VERA_DEVICES, VERA_CONTROLLER) -DEPENDENCIES = ['vera'] - _LOGGER = logging.getLogger(__name__) +DEPENDENCIES = ['vera'] -def setup_platform(hass, config, add_devices_callback, discovery_info=None): + +def setup_platform(hass, config, add_devices, discovery_info=None): """Find and return Vera locks.""" - add_devices_callback( + add_devices( VeraLock(device, VERA_CONTROLLER) for device in VERA_DEVICES['lock'])