mirror of
https://github.com/home-assistant/core.git
synced 2025-08-01 19:55:10 +02:00
Rename shadow as optimistic
This commit is contained in:
@@ -32,7 +32,7 @@ DOMAIN = "somfy"
|
|||||||
|
|
||||||
CONF_CLIENT_ID = "client_id"
|
CONF_CLIENT_ID = "client_id"
|
||||||
CONF_CLIENT_SECRET = "client_secret"
|
CONF_CLIENT_SECRET = "client_secret"
|
||||||
CONF_SHADOW = "shadow_cover"
|
CONF_OPTIMISTIC = "optimisitic"
|
||||||
|
|
||||||
SOMFY_AUTH_CALLBACK_PATH = "/auth/somfy/callback"
|
SOMFY_AUTH_CALLBACK_PATH = "/auth/somfy/callback"
|
||||||
SOMFY_AUTH_START = "/auth/somfy"
|
SOMFY_AUTH_START = "/auth/somfy"
|
||||||
@@ -43,7 +43,7 @@ CONFIG_SCHEMA = vol.Schema(
|
|||||||
{
|
{
|
||||||
vol.Required(CONF_CLIENT_ID): cv.string,
|
vol.Required(CONF_CLIENT_ID): cv.string,
|
||||||
vol.Required(CONF_CLIENT_SECRET): cv.string,
|
vol.Required(CONF_CLIENT_SECRET): cv.string,
|
||||||
vol.Optional(CONF_SHADOW): cv.boolean,
|
vol.Optional(CONF_OPTIMISTIC): cv.boolean,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
@@ -60,9 +60,9 @@ async def async_setup(hass, config):
|
|||||||
if DOMAIN not in config:
|
if DOMAIN not in config:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
hass.data[DOMAIN][CONF_SHADOW] = False
|
hass.data[DOMAIN][CONF_OPTIMISTIC] = False
|
||||||
if CONF_SHADOW in config[DOMAIN].keys():
|
if CONF_OPTIMISTIC in config[DOMAIN].keys():
|
||||||
hass.data[DOMAIN][CONF_SHADOW] = config[DOMAIN][CONF_SHADOW]
|
hass.data[DOMAIN][CONF_OPTIMISTIC] = config[DOMAIN][CONF_OPTIMISTIC]
|
||||||
|
|
||||||
config_flow.SomfyFlowHandler.async_register_implementation(
|
config_flow.SomfyFlowHandler.async_register_implementation(
|
||||||
hass,
|
hass,
|
||||||
|
@@ -8,7 +8,7 @@ from homeassistant.components.cover import (
|
|||||||
CoverDevice,
|
CoverDevice,
|
||||||
)
|
)
|
||||||
|
|
||||||
from . import API, CONF_SHADOW, DEVICES, DOMAIN, SomfyEntity
|
from . import API, CONF_OPTIMISTIC, DEVICES, DOMAIN, SomfyEntity
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||||
@@ -24,13 +24,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
|
|
||||||
devices = hass.data[DOMAIN][DEVICES]
|
devices = hass.data[DOMAIN][DEVICES]
|
||||||
|
|
||||||
if CONF_SHADOW in hass.data[DOMAIN].keys():
|
|
||||||
shadow = hass.data[DOMAIN][CONF_SHADOW]
|
|
||||||
else:
|
|
||||||
shadow = False
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
SomfyCover(cover, hass.data[DOMAIN][API], shadow)
|
SomfyCover(cover, hass.data[DOMAIN][API], hass.data[DOMAIN][CONF_OPTIMISTIC])
|
||||||
for cover in devices
|
for cover in devices
|
||||||
if categories & set(cover.categories)
|
if categories & set(cover.categories)
|
||||||
]
|
]
|
||||||
|
Reference in New Issue
Block a user