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

This commit is contained in:
springstan 2020-04-15 14:10:07 +02:00 committed by GitHub
parent 1ea7229f32
commit d842dacfd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 58 additions and 58 deletions

View file

@ -63,10 +63,10 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
"DHT11": Adafruit_DHT.DHT11,
"DHT22": Adafruit_DHT.DHT22,
}
sensor = available_sensors.get(config.get(CONF_SENSOR))
pin = config.get(CONF_PIN)
temperature_offset = config.get(CONF_TEMPERATURE_OFFSET)
humidity_offset = config.get(CONF_HUMIDITY_OFFSET)
sensor = available_sensors.get(config[CONF_SENSOR])
pin = config[CONF_PIN]
temperature_offset = config[CONF_TEMPERATURE_OFFSET]
humidity_offset = config[CONF_HUMIDITY_OFFSET]
if not sensor:
_LOGGER.error("DHT sensor type is not supported")
@ -74,7 +74,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
data = DHTClient(Adafruit_DHT, sensor, pin)
dev = []
name = config.get(CONF_NAME)
name = config[CONF_NAME]
try:
for variable in config[CONF_MONITORED_CONDITIONS]: