mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
fix pylint warnings
This commit is contained in:
parent
cfc2232c22
commit
c194121da6
@ -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,9 +94,10 @@ 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
|
||||||
self._vlow = value_low
|
self._vlow = value_low
|
||||||
self._bouncetime = bouncetime
|
self._bouncetime = bouncetime
|
||||||
@ -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…
x
Reference in New Issue
Block a user