mirror of
https://github.com/home-assistant/core.git
synced 2025-04-26 02:07:54 +00:00
Clean up Lutron Caseta (#47534)
This commit is contained in:
parent
4018d0a152
commit
07fd1b3b43
@ -67,7 +67,6 @@ PLATFORMS = ["light", "switch", "cover", "scene", "fan", "binary_sensor"]
|
|||||||
|
|
||||||
async def async_setup(hass, base_config):
|
async def async_setup(hass, base_config):
|
||||||
"""Set up the Lutron component."""
|
"""Set up the Lutron component."""
|
||||||
|
|
||||||
hass.data.setdefault(DOMAIN, {})
|
hass.data.setdefault(DOMAIN, {})
|
||||||
|
|
||||||
if DOMAIN in base_config:
|
if DOMAIN in base_config:
|
||||||
@ -92,7 +91,6 @@ async def async_setup(hass, base_config):
|
|||||||
|
|
||||||
async def async_setup_entry(hass, config_entry):
|
async def async_setup_entry(hass, config_entry):
|
||||||
"""Set up a bridge from a config entry."""
|
"""Set up a bridge from a config entry."""
|
||||||
|
|
||||||
host = config_entry.data[CONF_HOST]
|
host = config_entry.data[CONF_HOST]
|
||||||
keyfile = hass.config.path(config_entry.data[CONF_KEYFILE])
|
keyfile = hass.config.path(config_entry.data[CONF_KEYFILE])
|
||||||
certfile = hass.config.path(config_entry.data[CONF_CERTFILE])
|
certfile = hass.config.path(config_entry.data[CONF_CERTFILE])
|
||||||
@ -280,7 +278,6 @@ def _async_subscribe_pico_remote_events(hass, lip, button_devices_by_id):
|
|||||||
|
|
||||||
async def async_unload_entry(hass, config_entry):
|
async def async_unload_entry(hass, config_entry):
|
||||||
"""Unload the bridge bridge from a config entry."""
|
"""Unload the bridge bridge from a config entry."""
|
||||||
|
|
||||||
data = hass.data[DOMAIN][config_entry.entry_id]
|
data = hass.data[DOMAIN][config_entry.entry_id]
|
||||||
data[BRIDGE_LEAP].close()
|
data[BRIDGE_LEAP].close()
|
||||||
if data[BRIDGE_LIP]:
|
if data[BRIDGE_LIP]:
|
||||||
|
@ -16,7 +16,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
Adds occupancy groups from the Caseta bridge associated with the
|
Adds occupancy groups from the Caseta bridge associated with the
|
||||||
config_entry as binary_sensor entities.
|
config_entry as binary_sensor entities.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
entities = []
|
entities = []
|
||||||
data = hass.data[CASETA_DOMAIN][config_entry.entry_id]
|
data = hass.data[CASETA_DOMAIN][config_entry.entry_id]
|
||||||
bridge = data[BRIDGE_LEAP]
|
bridge = data[BRIDGE_LEAP]
|
||||||
|
@ -171,7 +171,6 @@ class LutronCasetaFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
This flow is triggered by `async_setup`.
|
This flow is triggered by `async_setup`.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
host = import_info[CONF_HOST]
|
host = import_info[CONF_HOST]
|
||||||
# Store the imported config for other steps in this flow to access.
|
# Store the imported config for other steps in this flow to access.
|
||||||
self.data[CONF_HOST] = host
|
self.data[CONF_HOST] = host
|
||||||
@ -213,7 +212,6 @@ class LutronCasetaFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
async def async_validate_connectable_bridge_config(self):
|
async def async_validate_connectable_bridge_config(self):
|
||||||
"""Check if we can connect to the bridge with the current config."""
|
"""Check if we can connect to the bridge with the current config."""
|
||||||
|
|
||||||
bridge = None
|
bridge = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -31,7 +31,6 @@ ATTR_ACTION = "action"
|
|||||||
ACTION_PRESS = "press"
|
ACTION_PRESS = "press"
|
||||||
ACTION_RELEASE = "release"
|
ACTION_RELEASE = "release"
|
||||||
|
|
||||||
CONF_TYPE = "type"
|
|
||||||
CONF_SUBTYPE = "subtype"
|
CONF_SUBTYPE = "subtype"
|
||||||
|
|
||||||
BRIDGE_TIMEOUT = 35
|
BRIDGE_TIMEOUT = 35
|
||||||
|
@ -24,7 +24,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
Adds shades from the Caseta bridge associated with the config_entry as
|
Adds shades from the Caseta bridge associated with the config_entry as
|
||||||
cover entities.
|
cover entities.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
entities = []
|
entities = []
|
||||||
data = hass.data[CASETA_DOMAIN][config_entry.entry_id]
|
data = hass.data[CASETA_DOMAIN][config_entry.entry_id]
|
||||||
bridge = data[BRIDGE_LEAP]
|
bridge = data[BRIDGE_LEAP]
|
||||||
|
@ -25,7 +25,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
Adds fan controllers from the Caseta bridge associated with the config_entry
|
Adds fan controllers from the Caseta bridge associated with the config_entry
|
||||||
as fan entities.
|
as fan entities.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
entities = []
|
entities = []
|
||||||
data = hass.data[CASETA_DOMAIN][config_entry.entry_id]
|
data = hass.data[CASETA_DOMAIN][config_entry.entry_id]
|
||||||
bridge = data[BRIDGE_LEAP]
|
bridge = data[BRIDGE_LEAP]
|
||||||
|
@ -33,7 +33,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
Adds dimmers from the Caseta bridge associated with the config_entry as
|
Adds dimmers from the Caseta bridge associated with the config_entry as
|
||||||
light entities.
|
light entities.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
entities = []
|
entities = []
|
||||||
data = hass.data[CASETA_DOMAIN][config_entry.entry_id]
|
data = hass.data[CASETA_DOMAIN][config_entry.entry_id]
|
||||||
bridge = data[BRIDGE_LEAP]
|
bridge = data[BRIDGE_LEAP]
|
||||||
|
@ -12,7 +12,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
Adds scenes from the Caseta bridge associated with the config_entry as
|
Adds scenes from the Caseta bridge associated with the config_entry as
|
||||||
scene entities.
|
scene entities.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
entities = []
|
entities = []
|
||||||
data = hass.data[CASETA_DOMAIN][config_entry.entry_id]
|
data = hass.data[CASETA_DOMAIN][config_entry.entry_id]
|
||||||
bridge = data[BRIDGE_LEAP]
|
bridge = data[BRIDGE_LEAP]
|
||||||
|
@ -15,7 +15,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
Adds switches from the Caseta bridge associated with the config_entry as
|
Adds switches from the Caseta bridge associated with the config_entry as
|
||||||
switch entities.
|
switch entities.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
entities = []
|
entities = []
|
||||||
data = hass.data[CASETA_DOMAIN][config_entry.entry_id]
|
data = hass.data[CASETA_DOMAIN][config_entry.entry_id]
|
||||||
bridge = data[BRIDGE_LEAP]
|
bridge = data[BRIDGE_LEAP]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user