Clean up access to config in various integrations v4 (#34174)

* Clean up access to config in various integrations v4

* Address review comments
This commit is contained in:
springstan authored and GitHub committed 2020-04-14 20:38:55 +02:00
1 parent 96aaa25aad
commit e2af216bcd
20 files changed
+53 -55

No files matched your search

@@ -46,11 +46,11 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Concord232 alarm control panel platform."""
name = config.get(CONF_NAME)
name = config[CONF_NAME]
code = config.get(CONF_CODE)
mode = config.get(CONF_MODE)
host = config.get(CONF_HOST)
port = config.get(CONF_PORT)
mode = config[CONF_MODE]
host = config[CONF_HOST]
port = config[CONF_PORT]
url = f"http://{host}:{port}"
@@ -44,10 +44,10 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Concord232 binary sensor platform."""
host = config.get(CONF_HOST)
port = config.get(CONF_PORT)
exclude = config.get(CONF_EXCLUDE_ZONES)
zone_types = config.get(CONF_ZONE_TYPES)
host = config[CONF_HOST]
port = config[CONF_PORT]
exclude = config[CONF_EXCLUDE_ZONES]
zone_types = config[CONF_ZONE_TYPES]
sensors = []
try: