move server address and verify ssl out of const

This commit is contained in:
bittles
2023-01-03 22:39:20 -05:00
parent 29b36a3529
commit 43bdf849c9
2 changed files with 7 additions and 7 deletions
+6 -4
View File
@@ -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,
+1 -3
View File
@@ -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