Fix format issues

pull/12483/head
Tom Harris 2018-02-17 17:24:02 -05:00
parent dd506602a1
commit a00c9f6205
3 changed files with 19 additions and 15 deletions

View File

@ -40,11 +40,12 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
class InsteonPLMFan(FanEntity):
"""An INSTEON fan component."""
def __init__(self, hass, device, stateKey, newnames, supported_features: int, ) -> None:
def __init__(self, hass, device, stateKey, newnames,
supported_features: int, ) -> None:
"""Initialize the entity."""
self._hass = hass
self._state = device.states[stateKey]
self._device = device
self._device = device
self._newnames = newnames
self._supported_features = supported_features
@ -113,7 +114,9 @@ class InsteonPLMFan(FanEntity):
@callback
def async_fan_update(self, deviceid, statename, val):
"""Receive notification from transport that new data exists."""
_LOGGER.info('Received update calback from PLM for device %s state %s', deviceid, statename)
_LOGGER.info('Received update calback from PLM for device %s state %s',
deviceid,
statename)
self.hass.async_add_job(self.async_update_ha_state())
@property
@ -128,7 +131,7 @@ class InsteonPLMFan(FanEntity):
return 0x3f
elif speed == SPEED_MEDIUM:
return 0xbe
elif SPEED == SPEED_HIGH:
elif speed == SPEED_HIGH:
return 0xff
return 0xbe
@ -139,4 +142,4 @@ class InsteonPLMFan(FanEntity):
return SPEED_MEDIUM
elif speed > 0:
return SPEED_LOW
return SPEED_OFF
return SPEED_OFF

View File

@ -65,7 +65,7 @@ def async_setup(hass, config):
newnames = ''
use_newnames = False
if newnames.lower() == 'y' or newnames.lower() == 'yes':
use_newnames == True
use_newnames = True
@callback
def async_plm_new_device(device):
@ -74,18 +74,19 @@ def async_setup(hass, config):
_LOGGER.debug('Starting Home-Assistant async_plm_new_device')
_LOGGER.debug(device)
for stateKey in device.states:
platformInfo = ipdb[device.states[stateKey]]
platformInfo = ipdb[device.states[stateKey]]
platform = platformInfo.platform
if platform is not None:
_LOGGER.info("New INSTEON PLM device: %s (%s) %s",
device.address,
device.states[stateKey].name,
platform)
device.address,
device.states[stateKey].name,
platform)
hass.async_add_job(
discovery.async_load_platform(
hass, platform, DOMAIN,
discovered=[{'address':device.address.hex,
'stateKey':stateKey,
discovered=[{'address': device.address.hex,
'stateKey': stateKey,
'newnames': use_newnames}],
hass_config=config))
@ -147,8 +148,8 @@ 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."""
states = [
State(OnOffSwitch_OutletTop, 'switch'),

View File

@ -88,7 +88,7 @@ class InsteonPLMDimmerDevice(Light):
@property
def is_on(self):
"""Return the boolean response if the node is on."""
_LOGGER.debug("on level for %s is %s",
_LOGGER.debug("on level for %s is %s",
self._device.id, self.brightness)
return bool(self.brightness)