Clean up access to config in various integrations v3 (#33842)
This commit is contained in:
parent
b46eee04e4
commit
21dfee831f
16 changed files with 52 additions and 52 deletions
|
@ -30,7 +30,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
"""Set up the BeagleBone Black GPIO devices."""
|
||||
pins = config.get(CONF_PINS)
|
||||
pins = config[CONF_PINS]
|
||||
|
||||
switches = []
|
||||
for pin, params in pins.items():
|
||||
|
@ -44,9 +44,9 @@ class BBBGPIOSwitch(ToggleEntity):
|
|||
def __init__(self, pin, params):
|
||||
"""Initialize the pin."""
|
||||
self._pin = pin
|
||||
self._name = params.get(CONF_NAME) or DEVICE_DEFAULT_NAME
|
||||
self._state = params.get(CONF_INITIAL)
|
||||
self._invert_logic = params.get(CONF_INVERT_LOGIC)
|
||||
self._name = params[CONF_NAME] or DEVICE_DEFAULT_NAME
|
||||
self._state = params[CONF_INITIAL]
|
||||
self._invert_logic = params[CONF_INVERT_LOGIC]
|
||||
|
||||
bbb_gpio.setup_output(self._pin)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue