Clean up access to config in various integrations v5 (#34206)
This commit is contained in:
parent
1ea7229f32
commit
d842dacfd6
21 changed files with 58 additions and 58 deletions
|
@ -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]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue