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
@@ -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]: