From 33838545065df5bc1a6640f7b7ebc2ae875b165a Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 5 Apr 2016 23:39:13 -0400 Subject: [PATCH] Move CONF_OPTIMISTIC to homeassistant.const. --- homeassistant/components/light/mqtt.py | 3 +-- homeassistant/components/lock/mqtt.py | 3 +-- homeassistant/components/mysensors.py | 4 ++-- homeassistant/const.py | 1 + 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/light/mqtt.py b/homeassistant/components/light/mqtt.py index 47d770e4cd2..65d7d925723 100644 --- a/homeassistant/components/light/mqtt.py +++ b/homeassistant/components/light/mqtt.py @@ -12,7 +12,7 @@ import voluptuous as vol import homeassistant.components.mqtt as mqtt from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_RGB_COLOR, Light) -from homeassistant.const import CONF_NAME +from homeassistant.const import CONF_NAME, CONF_OPTIMISTIC import homeassistant.helpers.config_validation as cv from homeassistant.helpers.template import render_with_possible_json_value @@ -31,7 +31,6 @@ CONF_RGB_COMMAND_TOPIC = 'rgb_command_topic' CONF_RGB_VALUE_TEMPLATE = 'rgb_value_template' CONF_PAYLOAD_ON = 'payload_on' CONF_PAYLOAD_OFF = 'payload_off' -CONF_OPTIMISTIC = 'optimistic' CONF_BRIGHTNESS_SCALE = 'brightness_scale' DEFAULT_NAME = 'MQTT Light' diff --git a/homeassistant/components/lock/mqtt.py b/homeassistant/components/lock/mqtt.py index 4cea06543e2..c6e81716adf 100644 --- a/homeassistant/components/lock/mqtt.py +++ b/homeassistant/components/lock/mqtt.py @@ -10,7 +10,7 @@ import voluptuous as vol import homeassistant.components.mqtt as mqtt from homeassistant.components.lock import LockDevice -from homeassistant.const import CONF_NAME, CONF_VALUE_TEMPLATE +from homeassistant.const import CONF_NAME, CONF_OPTIMISTIC, CONF_VALUE_TEMPLATE from homeassistant.helpers import template import homeassistant.helpers.config_validation as cv @@ -23,7 +23,6 @@ CONF_COMMAND_TOPIC = 'command_topic' CONF_RETAIN = 'retain' CONF_PAYLOAD_LOCK = 'payload_lock' CONF_PAYLOAD_UNLOCK = 'payload_unlock' -CONF_OPTIMISTIC = 'optimistic' DEFAULT_NAME = "MQTT Lock" DEFAULT_PAYLOAD_LOCK = "LOCK" diff --git a/homeassistant/components/mysensors.py b/homeassistant/components/mysensors.py index 2d3c8eb1f53..570a59151ce 100644 --- a/homeassistant/components/mysensors.py +++ b/homeassistant/components/mysensors.py @@ -9,7 +9,8 @@ import logging import homeassistant.bootstrap as bootstrap from homeassistant.const import ( ATTR_DISCOVERED, ATTR_SERVICE, EVENT_HOMEASSISTANT_START, - EVENT_HOMEASSISTANT_STOP, EVENT_PLATFORM_DISCOVERED, TEMP_CELCIUS) + EVENT_HOMEASSISTANT_STOP, EVENT_PLATFORM_DISCOVERED, TEMP_CELCIUS, + CONF_OPTIMISTIC) from homeassistant.helpers import validate_config CONF_GATEWAYS = 'gateways' @@ -19,7 +20,6 @@ CONF_PERSISTENCE = 'persistence' CONF_PERSISTENCE_FILE = 'persistence_file' CONF_VERSION = 'version' CONF_BAUD_RATE = 'baud_rate' -CONF_OPTIMISTIC = 'optimistic' DEFAULT_VERSION = '1.4' DEFAULT_BAUD_RATE = 115200 diff --git a/homeassistant/const.py b/homeassistant/const.py index 17dcc9e8602..69874c575a5 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -29,6 +29,7 @@ CONF_PASSWORD = "password" CONF_API_KEY = "api_key" CONF_ACCESS_TOKEN = "access_token" CONF_FILENAME = "filename" +CONF_OPTIMISTIC = 'optimistic' CONF_SCAN_INTERVAL = "scan_interval" CONF_VALUE_TEMPLATE = "value_template"