From 5d107ed74b596a5a0c94dea6260aa1095b900017 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 16 Nov 2014 22:18:52 -0800 Subject: [PATCH] Switched style checking to flake8 instead of pep8 --- .travis.yml | 4 ++-- homeassistant/__init__.py | 1 - homeassistant/components/__init__.py | 1 - homeassistant/components/device_tracker/__init__.py | 8 +++----- homeassistant/components/group.py | 4 ++-- homeassistant/components/http/__init__.py | 2 -- homeassistant/components/switch/__init__.py | 2 +- 7 files changed, 8 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 11585f5e11f..e15564b2b0f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,9 @@ python: - "3.4" install: - pip install -r requirements.txt - - pip install pep8 pylint coveralls + - pip install flake8 pylint coveralls script: - - pep8 homeassistant --exclude bower_components,external + - flake8 homeassistant --exclude bower_components,external - pylint homeassistant - coverage run --source=homeassistant -m homeassistant -t test after_success: diff --git a/homeassistant/__init__.py b/homeassistant/__init__.py index 5e50380b7d6..dbd5730e523 100644 --- a/homeassistant/__init__.py +++ b/homeassistant/__init__.py @@ -6,7 +6,6 @@ Home Assistant is a Home Automation framework for observing the state of entities and react to changes. """ -import sys import os import time import logging diff --git a/homeassistant/components/__init__.py b/homeassistant/components/__init__.py index 7d7ccca3f8b..3cb5f49939b 100644 --- a/homeassistant/components/__init__.py +++ b/homeassistant/components/__init__.py @@ -16,7 +16,6 @@ Each component should publish services only under its own domain. """ import itertools as it import logging -import importlib import homeassistant as ha import homeassistant.util as util diff --git a/homeassistant/components/device_tracker/__init__.py b/homeassistant/components/device_tracker/__init__.py index 1d5036fc1e4..277bdd17468 100644 --- a/homeassistant/components/device_tracker/__init__.py +++ b/homeassistant/components/device_tracker/__init__.py @@ -10,8 +10,6 @@ import os import csv from datetime import datetime, timedelta -import requests - import homeassistant as ha from homeassistant.loader import get_component import homeassistant.util as util @@ -268,9 +266,9 @@ class DeviceTracker(object): self.path_known_devices_file) # Remove entities that are no longer maintained - new_entity_ids = set([known_devices[device]['entity_id'] - for device in known_devices - if known_devices[device]['track']]) + new_entity_ids = set([known_devices[dev]['entity_id'] + for dev in known_devices + if known_devices[dev]['track']]) for entity_id in \ self.device_entity_ids - new_entity_ids: diff --git a/homeassistant/components/group.py b/homeassistant/components/group.py index 7880e197d28..8c0ff0b763a 100644 --- a/homeassistant/components/group.py +++ b/homeassistant/components/group.py @@ -80,8 +80,8 @@ def get_entity_ids(hass, entity_id, domain_filter=None): entity_ids = hass.states.get(entity_id).attributes[ATTR_ENTITY_ID] if domain_filter: - return [entity_id for entity_id in entity_ids - if entity_id.startswith(domain_filter)] + return [ent_id for ent_id in entity_ids + if ent_id.startswith(domain_filter)] else: return entity_ids diff --git a/homeassistant/components/http/__init__.py b/homeassistant/components/http/__init__.py index 3c23d466fb4..0072e5c2f38 100644 --- a/homeassistant/components/http/__init__.py +++ b/homeassistant/components/http/__init__.py @@ -85,8 +85,6 @@ from urllib.parse import urlparse, parse_qs import homeassistant as ha import homeassistant.remote as rem import homeassistant.util as util -from homeassistant.components import (STATE_ON, STATE_OFF, - SERVICE_TURN_ON, SERVICE_TURN_OFF) from . import frontend DOMAIN = "http" diff --git a/homeassistant/components/switch/__init__.py b/homeassistant/components/switch/__init__.py index 987cf726873..8ac877508fa 100644 --- a/homeassistant/components/switch/__init__.py +++ b/homeassistant/components/switch/__init__.py @@ -11,7 +11,7 @@ import homeassistant.util as util from homeassistant.loader import get_component from homeassistant.components import ( group, extract_entity_ids, STATE_ON, - SERVICE_TURN_ON, SERVICE_TURN_OFF, ATTR_ENTITY_ID, ATTR_FRIENDLY_NAME) + SERVICE_TURN_ON, SERVICE_TURN_OFF, ATTR_ENTITY_ID) DOMAIN = 'switch' DEPENDENCIES = []