Rename shadow as optimistic
parent
4f53e2c6c6
commit
e6e1db9cfb
|
@ -32,7 +32,7 @@ DOMAIN = "somfy"
|
|||
|
||||
CONF_CLIENT_ID = "client_id"
|
||||
CONF_CLIENT_SECRET = "client_secret"
|
||||
CONF_SHADOW = "shadow_cover"
|
||||
CONF_OPTIMISTIC = "optimisitic"
|
||||
|
||||
SOMFY_AUTH_CALLBACK_PATH = "/auth/somfy/callback"
|
||||
SOMFY_AUTH_START = "/auth/somfy"
|
||||
|
@ -43,7 +43,7 @@ CONFIG_SCHEMA = vol.Schema(
|
|||
{
|
||||
vol.Required(CONF_CLIENT_ID): 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:
|
||||
return True
|
||||
|
||||
hass.data[DOMAIN][CONF_SHADOW] = False
|
||||
if CONF_SHADOW in config[DOMAIN].keys():
|
||||
hass.data[DOMAIN][CONF_SHADOW] = config[DOMAIN][CONF_SHADOW]
|
||||
hass.data[DOMAIN][CONF_OPTIMISTIC] = False
|
||||
if CONF_OPTIMISTIC in config[DOMAIN].keys():
|
||||
hass.data[DOMAIN][CONF_OPTIMISTIC] = config[DOMAIN][CONF_OPTIMISTIC]
|
||||
|
||||
config_flow.SomfyFlowHandler.async_register_implementation(
|
||||
hass,
|
||||
|
|
|
@ -8,7 +8,7 @@ from homeassistant.components.cover import (
|
|||
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):
|
||||
|
@ -24,13 +24,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||
|
||||
devices = hass.data[DOMAIN][DEVICES]
|
||||
|
||||
if CONF_SHADOW in hass.data[DOMAIN].keys():
|
||||
shadow = hass.data[DOMAIN][CONF_SHADOW]
|
||||
else:
|
||||
shadow = False
|
||||
|
||||
return [
|
||||
SomfyCover(cover, hass.data[DOMAIN][API], shadow)
|
||||
SomfyCover(cover, hass.data[DOMAIN][API], hass.data[DOMAIN][CONF_OPTIMISTIC])
|
||||
for cover in devices
|
||||
if categories & set(cover.categories)
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue