Clean up access to config in various integrations v5 (#34206)

This commit is contained in:
springstan authored and GitHub committed 2020-04-15 14:10:07 +02:00
1 parent 1ea7229f32
commit d842dacfd6
21 files changed
+58 -58

No files matched your search

+5 -5
View File
@@ -44,11 +44,11 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up a D-Link Smart Plug."""
host = config.get(CONF_HOST)
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)
use_legacy_protocol = config.get(CONF_USE_LEGACY_PROTOCOL)
name = config.get(CONF_NAME)
host = config[CONF_HOST]
username = config[CONF_USERNAME]
password = config[CONF_PASSWORD]
use_legacy_protocol = config[CONF_USE_LEGACY_PROTOCOL]
name = config[CONF_NAME]
smartplug = SmartPlug(host, password, username, use_legacy_protocol)
data = SmartPlugData(smartplug)