From ae45d7dade7667f51873f8e09eff80896f5e6b23 Mon Sep 17 00:00:00 2001 From: tkdrob Date: Fri, 12 Feb 2021 17:32:56 -0500 Subject: [PATCH] Use core constants for rflink (#46440) --- homeassistant/components/rflink/__init__.py | 5 ++--- homeassistant/components/rflink/binary_sensor.py | 9 +++++++-- homeassistant/components/rflink/cover.py | 3 +-- homeassistant/components/rflink/light.py | 3 +-- homeassistant/components/rflink/sensor.py | 5 ++--- homeassistant/components/rflink/switch.py | 3 +-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/homeassistant/components/rflink/__init__.py b/homeassistant/components/rflink/__init__.py index 6bedea3ecd9..3cff3beed3c 100644 --- a/homeassistant/components/rflink/__init__.py +++ b/homeassistant/components/rflink/__init__.py @@ -10,7 +10,9 @@ import voluptuous as vol from homeassistant.const import ( ATTR_ENTITY_ID, + ATTR_STATE, CONF_COMMAND, + CONF_DEVICE_ID, CONF_HOST, CONF_PORT, EVENT_HOMEASSISTANT_STOP, @@ -29,15 +31,12 @@ from homeassistant.helpers.restore_state import RestoreEntity _LOGGER = logging.getLogger(__name__) ATTR_EVENT = "event" -ATTR_STATE = "state" CONF_ALIASES = "aliases" CONF_GROUP_ALIASES = "group_aliases" CONF_GROUP = "group" CONF_NOGROUP_ALIASES = "nogroup_aliases" CONF_DEVICE_DEFAULTS = "device_defaults" -CONF_DEVICE_ID = "device_id" -CONF_DEVICES = "devices" CONF_AUTOMATIC_ADD = "automatic_add" CONF_FIRE_EVENT = "fire_event" CONF_IGNORE_DEVICES = "ignore_devices" diff --git a/homeassistant/components/rflink/binary_sensor.py b/homeassistant/components/rflink/binary_sensor.py index dd16343898d..77a8a522f65 100644 --- a/homeassistant/components/rflink/binary_sensor.py +++ b/homeassistant/components/rflink/binary_sensor.py @@ -6,11 +6,16 @@ from homeassistant.components.binary_sensor import ( PLATFORM_SCHEMA, BinarySensorEntity, ) -from homeassistant.const import CONF_DEVICE_CLASS, CONF_FORCE_UPDATE, CONF_NAME +from homeassistant.const import ( + CONF_DEVICE_CLASS, + CONF_DEVICES, + CONF_FORCE_UPDATE, + CONF_NAME, +) import homeassistant.helpers.config_validation as cv import homeassistant.helpers.event as evt -from . import CONF_ALIASES, CONF_DEVICES, RflinkDevice +from . import CONF_ALIASES, RflinkDevice CONF_OFF_DELAY = "off_delay" DEFAULT_FORCE_UPDATE = False diff --git a/homeassistant/components/rflink/cover.py b/homeassistant/components/rflink/cover.py index 5eacce3afa8..2e6837d21ea 100644 --- a/homeassistant/components/rflink/cover.py +++ b/homeassistant/components/rflink/cover.py @@ -4,14 +4,13 @@ import logging import voluptuous as vol from homeassistant.components.cover import PLATFORM_SCHEMA, CoverEntity -from homeassistant.const import CONF_NAME, CONF_TYPE, STATE_OPEN +from homeassistant.const import CONF_DEVICES, CONF_NAME, CONF_TYPE, STATE_OPEN import homeassistant.helpers.config_validation as cv from homeassistant.helpers.restore_state import RestoreEntity from . import ( CONF_ALIASES, CONF_DEVICE_DEFAULTS, - CONF_DEVICES, CONF_FIRE_EVENT, CONF_GROUP, CONF_GROUP_ALIASES, diff --git a/homeassistant/components/rflink/light.py b/homeassistant/components/rflink/light.py index 6d63e12378d..fe74c979396 100644 --- a/homeassistant/components/rflink/light.py +++ b/homeassistant/components/rflink/light.py @@ -9,14 +9,13 @@ from homeassistant.components.light import ( SUPPORT_BRIGHTNESS, LightEntity, ) -from homeassistant.const import CONF_NAME, CONF_TYPE +from homeassistant.const import CONF_DEVICES, CONF_NAME, CONF_TYPE import homeassistant.helpers.config_validation as cv from . import ( CONF_ALIASES, CONF_AUTOMATIC_ADD, CONF_DEVICE_DEFAULTS, - CONF_DEVICES, CONF_FIRE_EVENT, CONF_GROUP, CONF_GROUP_ALIASES, diff --git a/homeassistant/components/rflink/sensor.py b/homeassistant/components/rflink/sensor.py index 2c27477e6c6..1a616c2ed90 100644 --- a/homeassistant/components/rflink/sensor.py +++ b/homeassistant/components/rflink/sensor.py @@ -5,7 +5,9 @@ import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( ATTR_UNIT_OF_MEASUREMENT, + CONF_DEVICES, CONF_NAME, + CONF_SENSOR_TYPE, CONF_UNIT_OF_MEASUREMENT, ) import homeassistant.helpers.config_validation as cv @@ -14,7 +16,6 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from . import ( CONF_ALIASES, CONF_AUTOMATIC_ADD, - CONF_DEVICES, DATA_DEVICE_REGISTER, DATA_ENTITY_LOOKUP, EVENT_KEY_ID, @@ -32,8 +33,6 @@ SENSOR_ICONS = { "temperature": "mdi:thermometer", } -CONF_SENSOR_TYPE = "sensor_type" - PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { vol.Optional(CONF_AUTOMATIC_ADD, default=True): cv.boolean, diff --git a/homeassistant/components/rflink/switch.py b/homeassistant/components/rflink/switch.py index 77e1f821bad..8f84286a616 100644 --- a/homeassistant/components/rflink/switch.py +++ b/homeassistant/components/rflink/switch.py @@ -2,13 +2,12 @@ import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity -from homeassistant.const import CONF_NAME +from homeassistant.const import CONF_DEVICES, CONF_NAME import homeassistant.helpers.config_validation as cv from . import ( CONF_ALIASES, CONF_DEVICE_DEFAULTS, - CONF_DEVICES, CONF_FIRE_EVENT, CONF_GROUP, CONF_GROUP_ALIASES,