mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
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?
|
# Did all devices leave the house?
|
||||||
elif (entity == device_group and
|
elif (entity == device_group and
|
||||||
new_state.state == STATE_NOT_HOME and lights_are_on
|
new_state.state == STATE_NOT_HOME and lights_are_on and
|
||||||
and not disable_turn_off):
|
not disable_turn_off):
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
"Everyone has left but there are lights on. Turning them off")
|
"Everyone has left but there are lights on. Turning them off")
|
||||||
|
@ -51,8 +51,8 @@ def setup(hass, config):
|
|||||||
""" Sets up the device tracker. """
|
""" Sets up the device tracker. """
|
||||||
|
|
||||||
# CONF_TYPE is deprecated for CONF_PLATOFRM. We keep supporting it for now.
|
# CONF_TYPE is deprecated for CONF_PLATOFRM. We keep supporting it for now.
|
||||||
if not (validate_config(config, {DOMAIN: [CONF_PLATFORM]}, _LOGGER)
|
if not (validate_config(config, {DOMAIN: [CONF_PLATFORM]}, _LOGGER) or
|
||||||
or validate_config(config, {DOMAIN: [CONF_TYPE]}, _LOGGER)):
|
validate_config(config, {DOMAIN: [CONF_TYPE]}, _LOGGER)):
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -200,8 +200,8 @@ class DeviceTracker(object):
|
|||||||
for device in new_devices:
|
for device in new_devices:
|
||||||
# See if the device scanner knows the name
|
# See if the device scanner knows the name
|
||||||
# else defaults to unknown device
|
# else defaults to unknown device
|
||||||
name = (self.device_scanner.get_device_name(device)
|
dname = self.device_scanner.get_device_name(device)
|
||||||
or "unknown_device")
|
name = dname or "unknown device"
|
||||||
|
|
||||||
writer.writerow((device, name, 0, ""))
|
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
|
# To ensure all the three expected lines are there, we sort the file
|
||||||
with open(self.known_dev_path) as fil:
|
with open(self.known_dev_path) as fil:
|
||||||
self.assertEqual(
|
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'],
|
'device,name,track,picture\n'],
|
||||||
sorted(fil))
|
sorted(fil))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user