move server address and verify ssl out of const
This commit is contained in:
@@ -23,8 +23,6 @@ from .const import (
|
|||||||
CONF_CONTINENT,
|
CONF_CONTINENT,
|
||||||
CONF_BUMPER,
|
CONF_BUMPER,
|
||||||
CONF_BUMPER_SERVER,
|
CONF_BUMPER_SERVER,
|
||||||
SERVER_ADDRESS,
|
|
||||||
VERIFY_SSL,
|
|
||||||
LOGGER
|
LOGGER
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -52,14 +50,18 @@ ECOVACS_API_DEVICEID = "".join(
|
|||||||
def setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
def setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||||
"""Set up the Ecovacs component."""
|
"""Set up the Ecovacs component."""
|
||||||
LOGGER.debug("Creating new Ecovacs component")
|
LOGGER.debug("Creating new Ecovacs component")
|
||||||
|
|
||||||
|
|
||||||
hass.data[ECOVACS_DEVICES] = []
|
hass.data[ECOVACS_DEVICES] = []
|
||||||
# if we're using bumper then define the server address
|
# if we're using bumper then define the server address
|
||||||
if CONF_BUMPER == True:
|
if CONF_BUMPER == True:
|
||||||
SERVER_ADDRESS = (config[DOMAIN].get(CONF_BUMPER_SERVER), 5223)
|
SERVER_ADDRESS = (config[DOMAIN].get(CONF_BUMPER_SERVER), 5223)
|
||||||
VERIFY_SSL = False
|
VERIFY_SSL = False
|
||||||
# if not server address is null and verify ssl true from const
|
else:
|
||||||
LOGGER.info("Bumper is set to %s with server address and verify ssl %s", CONF_BUMPER, VERIFY_SSL)
|
SERVER_ADDRESS = None
|
||||||
|
VERIFY_SSL = True
|
||||||
|
# if not server address is null and verify ssl true
|
||||||
|
LOGGER.info("Bumper is set to %s with server address %s and verify ssl %s", CONF_BUMPER, SERVER_ADDRESS, VERIFY_SSL)
|
||||||
|
|
||||||
ecovacs_api = EcoVacsAPI(
|
ecovacs_api = EcoVacsAPI(
|
||||||
ECOVACS_API_DEVICEID,
|
ECOVACS_API_DEVICEID,
|
||||||
|
|||||||
@@ -9,6 +9,4 @@ CONF_COUNTRY = "country"
|
|||||||
CONF_CONTINENT = "continent"
|
CONF_CONTINENT = "continent"
|
||||||
#bumper config vars
|
#bumper config vars
|
||||||
CONF_BUMPER = "bumper"
|
CONF_BUMPER = "bumper"
|
||||||
CONF_BUMPER_SERVER = "bumper_server"
|
CONF_BUMPER_SERVER = "bumper_server"
|
||||||
SERVER_ADDRESS = None
|
|
||||||
VERIFY_SSL = True
|
|
||||||
Reference in New Issue
Block a user