fix pylint warnings
This commit is contained in:
parent
cfc2232c22
commit
c194121da6
1 changed files with 5 additions and 3 deletions
|
@ -63,7 +63,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
if GPIO is None:
|
if GPIO is None:
|
||||||
_LOGGER.error('RPi.GPIO not available. rpi_gpio ports ignored.')
|
_LOGGER.error('RPi.GPIO not available. rpi_gpio ports ignored.')
|
||||||
return
|
return
|
||||||
|
# pylint: disable=no-member
|
||||||
GPIO.setmode(GPIO.BCM)
|
GPIO.setmode(GPIO.BCM)
|
||||||
|
|
||||||
sensors = []
|
sensors = []
|
||||||
|
@ -94,7 +94,8 @@ class RPiGPIOSensor(Entity):
|
||||||
""" Sets up the Raspberry PI GPIO ports. """
|
""" Sets up the Raspberry PI GPIO ports. """
|
||||||
def __init__(self, port_name, port_num, pull_mode,
|
def __init__(self, port_name, port_num, pull_mode,
|
||||||
value_high, value_low, bouncetime):
|
value_high, value_low, bouncetime):
|
||||||
self._name = port_name
|
# pylint: disable=no-member
|
||||||
|
self._name = port_name or DEVICE_DEFAULT_NAME
|
||||||
self._port = port_num
|
self._port = port_num
|
||||||
self._pull = GPIO.PUD_DOWN if pull_mode == "DOWN" else GPIO.PUD_UP
|
self._pull = GPIO.PUD_DOWN if pull_mode == "DOWN" else GPIO.PUD_UP
|
||||||
self._vhigh = value_high
|
self._vhigh = value_high
|
||||||
|
@ -105,6 +106,7 @@ class RPiGPIOSensor(Entity):
|
||||||
|
|
||||||
def edge_callback(channel):
|
def edge_callback(channel):
|
||||||
""" port changed state """
|
""" port changed state """
|
||||||
|
# pylint: disable=no-member
|
||||||
self._state = self._vhigh if GPIO.input(channel) else self._vlow
|
self._state = self._vhigh if GPIO.input(channel) else self._vlow
|
||||||
self.update_ha_state()
|
self.update_ha_state()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue