Format long lines

This commit is contained in:
Tom Harris
2018-02-19 16:23:43 -05:00
parent 5bef1fc741
commit 15e9eef13c
5 changed files with 28 additions and 14 deletions

View File

@@ -47,9 +47,11 @@ 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, None)
self._sensor_type = SENSOR_TYPES.get(self._insteon_device_state.name,
None)
self._insteon_device_state.register_updates(self.async_binarysensor_update)
self._insteon_device_state.register_updates(
self.async_binarysensor_update)
@property
def should_poll(self):
@@ -68,14 +70,16 @@ class InsteonPLMBinarySensor(BinarySensorDevice):
if self._insteon_device_state.group == 0x01:
name = self._insteon_device.id
else:
name = '{:s}_{:d}'.format(self._insteon_device.id, self._insteon_device_state.group)
name = '{:s}_{:d}'.format(self._insteon_device.id,
self._insteon_device_state.group)
return name
@property
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, self._insteon_device_state)
return insteon_plm.common_attributes(self._insteon_device,
self._insteon_device_state)
@callback
def async_binarysensor_update(self, deviceid, statename, val):

View File

@@ -77,14 +77,16 @@ class InsteonPLMFan(FanEntity):
if self._insteon_device_state.group == 0x01:
name = self._insteon_device.id
else:
name = '{:s}_{:d}'.format(self._insteon_device.id, self._insteon_device_state.group)
name = '{:s}_{:d}'.format(self._insteon_device.id,
self._insteon_device_state.group)
return name
@property
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, self._insteon_device_state)
return insteon_plm.common_attributes(self._insteon_device,
self._insteon_device_state)
@property
def speed(self) -> str:

View File

@@ -66,7 +66,8 @@ class InsteonPLMDimmerDevice(Light):
if self._insteon_device_state.group == 0x01:
name = self._insteon_device.id
else:
name = '{:s}_{:d}'.format(self._insteon_device.id, self._insteon_device_state.group)
name = '{:s}_{:d}'.format(self._insteon_device.id,
self._insteon_device_state.group)
return name
@property
@@ -89,7 +90,8 @@ class InsteonPLMDimmerDevice(Light):
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, self._insteon_device_state)
return insteon_plm.common_attributes(self._insteon_device,
self._insteon_device_state)
@callback
def async_light_update(self, entity_id, statename, val):

View File

@@ -63,7 +63,8 @@ class InsteonPLMSensorDevice(Entity):
if self._insteon_device_state.group == 0x01:
name = self._insteon_device.id
else:
name = '{:s}_{:d}'.format(self._insteon_device.id, self._insteon_device_state.group)
name = '{:s}_{:d}'.format(self._insteon_device.id,
self._insteon_device_state.group)
return name
@property
@@ -76,7 +77,8 @@ 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, self._insteon_device_state)
return insteon_plm.common_attributes(self._insteon_device,
self._insteon_device_state)
@callback
def async_sensor_update(self, deviceid, statename, val):

View File

@@ -70,7 +70,8 @@ class InsteonPLMSwitchDevice(SwitchDevice):
if self._insteon_device_state.group == 0x01:
name = self._insteon_device.id
else:
name = '{:s}_{:d}'.format(self._insteon_device.id, self._insteon_device_state.group)
name = '{:s}_{:d}'.format(self._insteon_device.id,
self._insteon_device_state.group)
return name
@property
@@ -83,7 +84,8 @@ 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, self._insteon_device_state)
return insteon_plm.common_attributes(self._insteon_device,
self._insteon_device_state)
@callback
def async_switch_update(self, deviceid, statename, val):
@@ -129,7 +131,8 @@ class InsteonPLMOpenClosedDevice(SwitchDevice):
if self._insteon_device_state.group == 0x01:
name = self._insteon_device.id
else:
name = '{:s}_{:d}'.format(self._insteon_device.id, self._insteon_device_state.group)
name = '{:s}_{:d}'.format(self._insteon_device.id,
self._insteon_device_state.group)
return name
@property
@@ -142,7 +145,8 @@ 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, self._insteon_device_state)
return insteon_plm.common_attributes(self._insteon_device,
self._insteon_device_state)
@callback
def async_relay_update(self, deviceid, statename, val):