mirror of
https://github.com/home-assistant/core.git
synced 2025-08-07 14:45:09 +02:00
lint cleanup
This commit is contained in:
@@ -20,10 +20,10 @@ SENSOR_TYPES = {'openClosedSensor': 'opening',
|
||||
'doorSensor': 'door',
|
||||
'leakSensor': 'moisture'}
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
"""Set up the INSTEON PLM device class for the hass platform."""
|
||||
|
||||
state_list = []
|
||||
plm = hass.data['insteon_plm']
|
||||
|
||||
@@ -43,7 +43,7 @@ class InsteonPLMBinarySensor(BinarySensorDevice):
|
||||
"""A Class for an Insteon device state."""
|
||||
|
||||
def __init__(self, hass, device, state_key):
|
||||
"""Initialize the binarysensor."""
|
||||
"""Initialize the INSTEON PLM binary sensor."""
|
||||
self._hass = hass
|
||||
self._insteon_device_state = device.states[state_key]
|
||||
self._insteon_device = device
|
||||
@@ -65,7 +65,7 @@ class InsteonPLMBinarySensor(BinarySensorDevice):
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Return the name of the node. (used for Entity_ID)"""
|
||||
"""Return the name of the node (used for Entity_ID)."""
|
||||
name = ''
|
||||
if self._insteon_device_state.group == 0x01:
|
||||
name = self._insteon_device.id
|
||||
|
@@ -30,7 +30,6 @@ _LOGGER = logging.getLogger(__name__)
|
||||
@asyncio.coroutine
|
||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
"""Set up the INSTEON PLM device class for the hass platform."""
|
||||
|
||||
state_list = []
|
||||
plm = hass.data['insteon_plm']
|
||||
|
||||
@@ -72,7 +71,7 @@ class InsteonPLMFan(FanEntity):
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Return the name of the node. (used for Entity_ID)"""
|
||||
"""Return the name of the node (used for Entity_ID)."""
|
||||
name = ''
|
||||
if self._insteon_device_state.group == 0x01:
|
||||
name = self._insteon_device.id
|
||||
|
@@ -46,7 +46,6 @@ def async_setup(hass, config):
|
||||
@callback
|
||||
def async_plm_new_device(device):
|
||||
"""Detect device from transport to be delegated to platform."""
|
||||
|
||||
for state_key in device.states:
|
||||
platform_info = ipdb[device.states[state_key]]
|
||||
platform = platform_info.platform
|
||||
@@ -119,11 +118,9 @@ State = collections.namedtuple('Product', 'stateType platform')
|
||||
|
||||
|
||||
class IPDB(object):
|
||||
"""Embodies the INSTEON Product Database static data
|
||||
and access methods."""
|
||||
|
||||
"""Embodies the INSTEON Product Database static data and access methods."""
|
||||
def __init__(self):
|
||||
|
||||
"""Create the INSTEON Product Database (IPDB)."""
|
||||
from insteonplm.states.onOff import (OnOffSwitch,
|
||||
OnOffSwitch_OutletTop,
|
||||
OnOffSwitch_OutletBottom,
|
||||
@@ -148,17 +145,20 @@ and access methods."""
|
||||
State(VariableSensor, 'sensor'),
|
||||
|
||||
State(DimmableSwitch_Fan, 'fan'),
|
||||
State(DimmableSwitch, 'light')
|
||||
]
|
||||
State(DimmableSwitch, 'light')]
|
||||
|
||||
def __len__(self):
|
||||
"""Return the number of INSTEON state types mapped to HA platforms."""
|
||||
return len(self.states)
|
||||
|
||||
def __iter__(self):
|
||||
"""Itterate through the INSTEON state types to HA platforms."""
|
||||
for product in self.states:
|
||||
yield product
|
||||
|
||||
def __getitem__(self, key):
|
||||
"""Return a Home Assistant platform from an INSTEON state type.
|
||||
"""
|
||||
for state in self.states:
|
||||
if isinstance(key, state.stateType):
|
||||
return state
|
||||
|
@@ -22,7 +22,6 @@ MAX_BRIGHTNESS = 255
|
||||
@asyncio.coroutine
|
||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
"""Set up the Insteon PLM device."""
|
||||
|
||||
state_list = []
|
||||
plm = hass.data['insteon_plm']
|
||||
|
||||
@@ -61,7 +60,7 @@ class InsteonPLMDimmerDevice(Light):
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Return the name of the node. (used for Entity_ID)"""
|
||||
"""Return the name of the node (used for Entity_ID)."""
|
||||
name = ''
|
||||
if self._insteon_device_state.group == 0x01:
|
||||
name = self._insteon_device.id
|
||||
|
@@ -19,7 +19,6 @@ _LOGGER = logging.getLogger(__name__)
|
||||
@asyncio.coroutine
|
||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
"""Set up the INSTEON PLM device class for the hass platform."""
|
||||
|
||||
state_list = []
|
||||
plm = hass.data['insteon_plm']
|
||||
|
||||
@@ -58,7 +57,7 @@ class InsteonPLMSensorDevice(Entity):
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Return the name of the node. (used for Entity_ID)"""
|
||||
"""Return the name of the node (used for Entity_ID)."""
|
||||
name = ''
|
||||
if self._insteon_device_state.group == 0x01:
|
||||
name = self._insteon_device.id
|
||||
|
@@ -19,7 +19,6 @@ _LOGGER = logging.getLogger(__name__)
|
||||
@asyncio.coroutine
|
||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
"""Set up the INSTEON PLM device class for the hass platform."""
|
||||
|
||||
state_list = []
|
||||
plm = hass.data['insteon_plm']
|
||||
|
||||
@@ -65,7 +64,7 @@ class InsteonPLMSwitchDevice(SwitchDevice):
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Return the name of the node. (used for Entity_ID)"""
|
||||
"""Return the name of the node (used for Entity_ID)."""
|
||||
name = ''
|
||||
if self._insteon_device_state.group == 0x01:
|
||||
name = self._insteon_device.id
|
||||
@@ -99,7 +98,7 @@ class InsteonPLMSwitchDevice(SwitchDevice):
|
||||
|
||||
@asyncio.coroutine
|
||||
def async_turn_off(self, **kwargs):
|
||||
"""Turn device off"""
|
||||
"""Turn device off."""
|
||||
self._insteon_device_state.off()
|
||||
|
||||
|
||||
@@ -160,5 +159,5 @@ class InsteonPLMOpenClosedDevice(SwitchDevice):
|
||||
|
||||
@asyncio.coroutine
|
||||
def async_turn_off(self, **kwargs):
|
||||
"""Turn device off"""
|
||||
"""Turn device off."""
|
||||
self._insteon_device_state.close()
|
||||
|
Reference in New Issue
Block a user