From 26ddd7e82d8e10cb17e3a222dc8ede6a28a701d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 1 Jul 2018 10:29:12 +0300 Subject: [PATCH 1/2] Remove some unused imports --- homeassistant/components/google_assistant/http.py | 4 +--- homeassistant/components/google_assistant/smart_home.py | 8 -------- homeassistant/config.py | 2 +- homeassistant/helpers/service.py | 2 -- homeassistant/helpers/translation.py | 2 -- homeassistant/loader.py | 8 +------- 6 files changed, 3 insertions(+), 23 deletions(-) diff --git a/homeassistant/components/google_assistant/http.py b/homeassistant/components/google_assistant/http.py index 65079a1a26e754..05bc3cbd01c0a4 100644 --- a/homeassistant/components/google_assistant/http.py +++ b/homeassistant/components/google_assistant/http.py @@ -10,10 +10,8 @@ from aiohttp.web import Request, Response # Typing imports -# pylint: disable=unused-import from homeassistant.components.http import HomeAssistantView -from homeassistant.core import HomeAssistant, callback # NOQA -from homeassistant.helpers.entity import Entity # NOQA +from homeassistant.core import callback from .const import ( GOOGLE_ASSISTANT_API_ENDPOINT, diff --git a/homeassistant/components/google_assistant/smart_home.py b/homeassistant/components/google_assistant/smart_home.py index f20d4f747cceb8..927139a483e0a8 100644 --- a/homeassistant/components/google_assistant/smart_home.py +++ b/homeassistant/components/google_assistant/smart_home.py @@ -3,14 +3,6 @@ from itertools import product import logging -# Typing imports -# pylint: disable=unused-import -# if False: -from aiohttp.web import Request, Response # NOQA -from typing import Dict, Tuple, Any, Optional # NOQA -from homeassistant.helpers.entity import Entity # NOQA -from homeassistant.core import HomeAssistant # NOQA -from homeassistant.util.unit_system import UnitSystem # NOQA from homeassistant.util.decorator import Registry from homeassistant.core import callback diff --git a/homeassistant/config.py b/homeassistant/config.py index 2906f07a307c0f..52ff0e19c598b2 100644 --- a/homeassistant/config.py +++ b/homeassistant/config.py @@ -7,7 +7,7 @@ import re import shutil # pylint: disable=unused-import -from typing import Any, List, Tuple, Optional # NOQA +from typing import Any, Tuple, Optional # noqa: F401 import voluptuous as vol from voluptuous.humanize import humanize_error diff --git a/homeassistant/helpers/service.py b/homeassistant/helpers/service.py index 9114a4db941cfc..7ab90b7a048910 100644 --- a/homeassistant/helpers/service.py +++ b/homeassistant/helpers/service.py @@ -1,7 +1,5 @@ """Service calling related helpers.""" import logging -# pylint: disable=unused-import -from typing import Optional # NOQA from os import path import voluptuous as vol diff --git a/homeassistant/helpers/translation.py b/homeassistant/helpers/translation.py index f1335f733466e5..81ec046f2e9966 100644 --- a/homeassistant/helpers/translation.py +++ b/homeassistant/helpers/translation.py @@ -1,7 +1,5 @@ """Translation string lookup helpers.""" import logging -# pylint: disable=unused-import -from typing import Optional # NOQA from os import path from homeassistant import config_entries diff --git a/homeassistant/loader.py b/homeassistant/loader.py index e3e41e09db23d3..9e5efffdccbab1 100644 --- a/homeassistant/loader.py +++ b/homeassistant/loader.py @@ -16,17 +16,11 @@ import sys from types import ModuleType -# pylint: disable=unused-import -from typing import Dict, List, Optional, Sequence, Set # NOQA +from typing import Optional, Set from homeassistant.const import PLATFORM_FORMAT from homeassistant.util import OrderedSet -# Typing imports -# pylint: disable=using-constant-test,unused-import -if False: - from homeassistant.core import HomeAssistant # NOQA - PREPARED = False DEPENDENCY_BLACKLIST = set(('config',)) From b7f1c7b98f2c0a945d807096f22bdae8dee9b2a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 1 Jul 2018 10:31:33 +0300 Subject: [PATCH 2/2] Fix a flake8 E271 --- homeassistant/components/sensor/tibber.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/sensor/tibber.py b/homeassistant/components/sensor/tibber.py index 42568a6b9ada4b..c75c40dd929ca3 100644 --- a/homeassistant/components/sensor/tibber.py +++ b/homeassistant/components/sensor/tibber.py @@ -123,7 +123,7 @@ def unique_id(self): async def _fetch_data(self): try: await self._tibber_home.update_info() - await self._tibber_home.update_price_info() + await self._tibber_home.update_price_info() except (asyncio.TimeoutError, aiohttp.ClientError): return data = self._tibber_home.info['viewer']['home']