mirror of
https://github.com/home-assistant/core.git
synced 2025-08-10 08:05:06 +02:00
Pylint clean up
This commit is contained in:
@@ -47,7 +47,7 @@ class InsteonPLMBinarySensor(BinarySensorDevice):
|
||||
self._hass = hass
|
||||
self._insteon_device_state = device.states[state_key]
|
||||
self._insteon_device = device
|
||||
self._sensor_type = SENSOR_TYPES.get(self._insteon_device_state.name,
|
||||
self._sensor_type = SENSOR_TYPES.get(self._insteon_device_state.name,
|
||||
None)
|
||||
|
||||
self._insteon_device_state.register_updates(
|
||||
@@ -70,7 +70,7 @@ class InsteonPLMBinarySensor(BinarySensorDevice):
|
||||
if self._insteon_device_state.group == 0x01:
|
||||
name = self._insteon_device.id
|
||||
else:
|
||||
name = '{:s}_{:d}'.format(self._insteon_device.id,
|
||||
name = '{:s}_{:d}'.format(self._insteon_device.id,
|
||||
self._insteon_device_state.group)
|
||||
return name
|
||||
|
||||
@@ -78,7 +78,7 @@ class InsteonPLMBinarySensor(BinarySensorDevice):
|
||||
def device_state_attributes(self):
|
||||
"""Provide attributes for display on device card."""
|
||||
insteon_plm = get_component('insteon_plm')
|
||||
return insteon_plm.common_attributes(self._insteon_device,
|
||||
return insteon_plm.common_attributes(self._insteon_device,
|
||||
self._insteon_device_state)
|
||||
|
||||
@callback
|
||||
|
@@ -77,7 +77,7 @@ class InsteonPLMFan(FanEntity):
|
||||
if self._insteon_device_state.group == 0x01:
|
||||
name = self._insteon_device.id
|
||||
else:
|
||||
name = '{:s}_{:d}'.format(self._insteon_device.id,
|
||||
name = '{:s}_{:d}'.format(self._insteon_device.id,
|
||||
self._insteon_device_state.group)
|
||||
return name
|
||||
|
||||
@@ -85,7 +85,7 @@ class InsteonPLMFan(FanEntity):
|
||||
def device_state_attributes(self):
|
||||
"""Provide attributes for display on device card."""
|
||||
insteon_plm = get_component('insteon_plm')
|
||||
return insteon_plm.common_attributes(self._insteon_device,
|
||||
return insteon_plm.common_attributes(self._insteon_device,
|
||||
self._insteon_device_state)
|
||||
|
||||
@property
|
||||
|
@@ -63,7 +63,7 @@ class InsteonPLMSensorDevice(Entity):
|
||||
if self._insteon_device_state.group == 0x01:
|
||||
name = self._insteon_device.id
|
||||
else:
|
||||
name = '{:s}_{:d}'.format(self._insteon_device.id,
|
||||
name = '{:s}_{:d}'.format(self._insteon_device.id,
|
||||
self._insteon_device_state.group)
|
||||
return name
|
||||
|
||||
@@ -77,7 +77,7 @@ class InsteonPLMSensorDevice(Entity):
|
||||
def device_state_attributes(self):
|
||||
"""Provide attributes for display on device card."""
|
||||
insteon_plm = get_component('insteon_plm')
|
||||
return insteon_plm.common_attributes(self._insteon_device,
|
||||
return insteon_plm.common_attributes(self._insteon_device,
|
||||
self._insteon_device_state)
|
||||
|
||||
@callback
|
||||
|
@@ -28,13 +28,13 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
device = plm.devices[address]
|
||||
state_key = device_info['state_key']
|
||||
|
||||
stateName = device.states[state_key].name
|
||||
state_name = device.states[state_key].name
|
||||
|
||||
if stateName in ['lightOnOff', 'outletTopOnOff', 'outletBottomOnOff']:
|
||||
if state_name in ['lightOnOff', 'outletTopOnOff', 'outletBottomOnOff']:
|
||||
state_list.append(InsteonPLMSwitchDevice(hass,
|
||||
device,
|
||||
state_key))
|
||||
elif stateName == 'openClosedRelay':
|
||||
elif state_name == 'openClosedRelay':
|
||||
state_list.append(InsteonPLMOpenClosedDevice(hass,
|
||||
device,
|
||||
state_key))
|
||||
@@ -70,7 +70,7 @@ class InsteonPLMSwitchDevice(SwitchDevice):
|
||||
if self._insteon_device_state.group == 0x01:
|
||||
name = self._insteon_device.id
|
||||
else:
|
||||
name = '{:s}_{:d}'.format(self._insteon_device.id,
|
||||
name = '{:s}_{:d}'.format(self._insteon_device.id,
|
||||
self._insteon_device_state.group)
|
||||
return name
|
||||
|
||||
@@ -84,7 +84,7 @@ class InsteonPLMSwitchDevice(SwitchDevice):
|
||||
def device_state_attributes(self):
|
||||
"""Provide attributes for display on device card."""
|
||||
insteon_plm = get_component('insteon_plm')
|
||||
return insteon_plm.common_attributes(self._insteon_device,
|
||||
return insteon_plm.common_attributes(self._insteon_device,
|
||||
self._insteon_device_state)
|
||||
|
||||
@callback
|
||||
@@ -131,7 +131,7 @@ class InsteonPLMOpenClosedDevice(SwitchDevice):
|
||||
if self._insteon_device_state.group == 0x01:
|
||||
name = self._insteon_device.id
|
||||
else:
|
||||
name = '{:s}_{:d}'.format(self._insteon_device.id,
|
||||
name = '{:s}_{:d}'.format(self._insteon_device.id,
|
||||
self._insteon_device_state.group)
|
||||
return name
|
||||
|
||||
@@ -145,7 +145,7 @@ class InsteonPLMOpenClosedDevice(SwitchDevice):
|
||||
def device_state_attributes(self):
|
||||
"""Provide attributes for display on device card."""
|
||||
insteon_plm = get_component('insteon_plm')
|
||||
return insteon_plm.common_attributes(self._insteon_device,
|
||||
return insteon_plm.common_attributes(self._insteon_device,
|
||||
self._insteon_device_state)
|
||||
|
||||
@callback
|
||||
|
Reference in New Issue
Block a user