mirror of https://github.com/home-assistant/core
Style fixes to satisfy updated Flake8
This commit is contained in:
parent
37a9dbf1d5
commit
8e29910e77
|
@ -147,8 +147,8 @@ def setup(hass, config):
|
|||
|
||||
# Did all devices leave the house?
|
||||
elif (entity == device_group and
|
||||
new_state.state == STATE_NOT_HOME and lights_are_on
|
||||
and not disable_turn_off):
|
||||
new_state.state == STATE_NOT_HOME and lights_are_on and
|
||||
not disable_turn_off):
|
||||
|
||||
logger.info(
|
||||
"Everyone has left but there are lights on. Turning them off")
|
||||
|
|
|
@ -51,8 +51,8 @@ def setup(hass, config):
|
|||
""" Sets up the device tracker. """
|
||||
|
||||
# CONF_TYPE is deprecated for CONF_PLATOFRM. We keep supporting it for now.
|
||||
if not (validate_config(config, {DOMAIN: [CONF_PLATFORM]}, _LOGGER)
|
||||
or validate_config(config, {DOMAIN: [CONF_TYPE]}, _LOGGER)):
|
||||
if not (validate_config(config, {DOMAIN: [CONF_PLATFORM]}, _LOGGER) or
|
||||
validate_config(config, {DOMAIN: [CONF_TYPE]}, _LOGGER)):
|
||||
|
||||
return False
|
||||
|
||||
|
@ -200,8 +200,8 @@ class DeviceTracker(object):
|
|||
for device in new_devices:
|
||||
# See if the device scanner knows the name
|
||||
# else defaults to unknown device
|
||||
name = (self.device_scanner.get_device_name(device)
|
||||
or "unknown_device")
|
||||
dname = self.device_scanner.get_device_name(device)
|
||||
name = dname or "unknown device"
|
||||
|
||||
writer.writerow((device, name, 0, ""))
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ class TestComponentsDeviceTracker(unittest.TestCase):
|
|||
# To ensure all the three expected lines are there, we sort the file
|
||||
with open(self.known_dev_path) as fil:
|
||||
self.assertEqual(
|
||||
['dev1,unknown_device,0,\n', 'dev2,DEV2,0,\n',
|
||||
['dev1,unknown device,0,\n', 'dev2,DEV2,0,\n',
|
||||
'device,name,track,picture\n'],
|
||||
sorted(fil))
|
||||
|
||||
|
|
Loading…
Reference in New Issue