Update name (#5324)

This commit is contained in:
Fabian Affolter 2017-01-14 17:08:48 +01:00 committed by GitHub
parent ef4a9bf354
commit 2aa996b558
2 changed files with 7 additions and 20 deletions

View file

@ -18,7 +18,7 @@ DOMAIN = 'bbb_gpio'
# pylint: disable=no-member # pylint: disable=no-member
def setup(hass, config): def setup(hass, config):
"""Setup the Beaglebone black GPIO component.""" """Set up the BeagleBone Black GPIO component."""
# pylint: disable=import-error # pylint: disable=import-error
import Adafruit_BBIO.GPIO as GPIO import Adafruit_BBIO.GPIO as GPIO
@ -71,7 +71,4 @@ def edge_detect(pin, event_callback, bounce):
# pylint: disable=import-error,undefined-variable # pylint: disable=import-error,undefined-variable
import Adafruit_BBIO.GPIO as GPIO import Adafruit_BBIO.GPIO as GPIO
GPIO.add_event_detect( GPIO.add_event_detect(
pin, pin, GPIO.BOTH, callback=event_callback, bouncetime=bounce)
GPIO.BOTH,
callback=event_callback,
bouncetime=bounce)

View file

@ -1,18 +1,8 @@
""" """
Allows to configure a switch using BBB GPIO. Allows to configure a switch using BeagleBone Black GPIO.
Switch example for two GPIOs pins P9_12 and P9_42 For more details about this component, please refer to the documentation at
Allowed GPIO pin name is GPIOxxx or Px_x https://home-assistant.io/components/switch.bbb_gpio/
switch:
- platform: bbb_gpio
pins:
GPIO0_7:
name: LED Red
P9_12:
name: LED Green
initial: true
invert_logic: true
""" """
import logging import logging
@ -46,7 +36,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
# pylint: disable=unused-argument # pylint: disable=unused-argument
def setup_platform(hass, config, add_devices, discovery_info=None): def setup_platform(hass, config, add_devices, discovery_info=None):
"""Setup the Beaglebone GPIO devices.""" """Set up the BeagleBone Black GPIO devices."""
pins = config.get(CONF_PINS) pins = config.get(CONF_PINS)
switches = [] switches = []
@ -56,7 +46,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
class BBBGPIOSwitch(ToggleEntity): class BBBGPIOSwitch(ToggleEntity):
"""Representation of a Beaglebone GPIO.""" """Representation of a BeagleBone Black GPIO."""
def __init__(self, pin, params): def __init__(self, pin, params):
"""Initialize the pin.""" """Initialize the pin."""