From 591d13bc494b6faef8096bb7a16199319ad2edd1 Mon Sep 17 00:00:00 2001 From: Jan Bouwhuis Date: Sat, 29 Oct 2022 10:22:59 +0200 Subject: [PATCH] Move MQTT CONF_SCHEMA from light and vacuum to .const (#81152) Move CONF_SCHEMA to .const --- homeassistant/components/mqtt/const.py | 1 + homeassistant/components/mqtt/light/schema.py | 2 +- homeassistant/components/mqtt/vacuum/schema.py | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/mqtt/const.py b/homeassistant/components/mqtt/const.py index 1dc25c1e78c..dc8aa2f2c74 100644 --- a/homeassistant/components/mqtt/const.py +++ b/homeassistant/components/mqtt/const.py @@ -19,6 +19,7 @@ CONF_ENCODING = "encoding" CONF_KEEPALIVE = "keepalive" CONF_QOS = ATTR_QOS CONF_RETAIN = ATTR_RETAIN +CONF_SCHEMA = "schema" CONF_STATE_TOPIC = "state_topic" CONF_STATE_VALUE_TEMPLATE = "state_value_template" CONF_TOPIC = "topic" diff --git a/homeassistant/components/mqtt/light/schema.py b/homeassistant/components/mqtt/light/schema.py index a7ab5e986a7..6e2ac60b28d 100644 --- a/homeassistant/components/mqtt/light/schema.py +++ b/homeassistant/components/mqtt/light/schema.py @@ -1,7 +1,7 @@ """Shared schema code.""" import voluptuous as vol -CONF_SCHEMA = "schema" +from ..const import CONF_SCHEMA MQTT_LIGHT_SCHEMA_SCHEMA = vol.Schema( { diff --git a/homeassistant/components/mqtt/vacuum/schema.py b/homeassistant/components/mqtt/vacuum/schema.py index 949b5cede9c..d2ed91fa631 100644 --- a/homeassistant/components/mqtt/vacuum/schema.py +++ b/homeassistant/components/mqtt/vacuum/schema.py @@ -1,7 +1,8 @@ """Shared schema code.""" import voluptuous as vol -CONF_SCHEMA = "schema" +from ..const import CONF_SCHEMA + LEGACY = "legacy" STATE = "state"