Clean up ssl usage (#33960)

* Clean up ssl usage

* Revert config[CONF_SSL] from sonarr, radarr and mfi
This commit is contained in:
springstan 2020-04-10 22:01:57 +02:00 committed by GitHub
parent cfef8ee961
commit 8198970af9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 44 additions and 55 deletions

View file

@ -51,12 +51,12 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the pyLoad sensors."""
host = config.get(CONF_HOST)
port = config.get(CONF_PORT)
ssl = "s" if config.get(CONF_SSL) else ""
protocol = "https" if config[CONF_SSL] else "http"
name = config.get(CONF_NAME)
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)
monitored_types = config.get(CONF_MONITORED_VARIABLES)
url = f"http{ssl}://{host}:{port}/api/"
url = f"{protocol}://{host}:{port}/api/"
try:
pyloadapi = PyLoadAPI(api_url=url, username=username, password=password)