From 47c941ba332c79cc0ed167ad2654d58fca7a04d0 Mon Sep 17 00:00:00 2001 From: Julius Mittenzwei Date: Wed, 10 Jan 2018 21:33:12 +0100 Subject: [PATCH] isort --- examples/example_tunnel.py | 2 +- test/climate_test.py | 6 +++--- test/config_test.py | 4 ++-- test/cover_test.py | 2 +- test/datetime_test.py | 1 - test/dpt_4byte_test.py | 3 +-- test/dpt_float_test.py | 5 +++-- test/knxip_routing_indication_test.py | 4 ++-- test/knxip_tunnelling_request_test.py | 2 +- test/light_test.py | 2 +- test/sensor_test.py | 2 +- test/str_test.py | 7 ++++--- test/switch_test.py | 2 +- test/telegram_received_cb_test.py | 2 +- xknx/core/config.py | 4 ++-- xknx/devices/binary_sensor.py | 2 +- xknx/devices/climate.py | 4 ++-- xknx/devices/datetime.py | 4 +++- xknx/devices/light.py | 2 +- xknx/devices/notification.py | 2 +- xknx/devices/remote_value.py | 4 ++-- xknx/devices/sensor.py | 13 +++++++------ xknx/knx/address.py | 2 +- xknx/knx/dpt.py | 1 + xknx/knx/dpt_4byte.py | 1 + xknx/knx/dpt_datetime.py | 4 ++-- xknx/knx/dpt_float.py | 1 + xknx/knx/dpt_hvac_mode.py | 2 ++ xknx/knx/dpt_time.py | 3 +-- xknx/knxip/cemi_frame.py | 2 +- 30 files changed, 51 insertions(+), 44 deletions(-) diff --git a/examples/example_tunnel.py b/examples/example_tunnel.py index 6ba28062c..ca4f922a6 100644 --- a/examples/example_tunnel.py +++ b/examples/example_tunnel.py @@ -3,7 +3,7 @@ from xknx import XKNX from xknx.io import GatewayScanner, Tunnel -from xknx.knx import GroupAddress, PhysicalAddress, DPTBinary, Telegram +from xknx.knx import DPTBinary, GroupAddress, PhysicalAddress, Telegram async def main(): diff --git a/test/climate_test.py b/test/climate_test.py index 9d1a3b626..73cbf23b8 100644 --- a/test/climate_test.py +++ b/test/climate_test.py @@ -6,9 +6,9 @@ from xknx import XKNX from xknx.devices import Climate from xknx.exceptions import DeviceIllegalValue -from xknx.knx import (GroupAddress, DPTArray, DPTBinary, DPTControllerStatus, - DPT2ByteFloat, DPTHVACMode, DPTTemperature, DPTValue1Count, - HVACOperationMode, Telegram, TelegramType) +from xknx.knx import (DPT2ByteFloat, DPTArray, DPTBinary, DPTControllerStatus, + DPTHVACMode, DPTTemperature, DPTValue1Count, + GroupAddress, HVACOperationMode, Telegram, TelegramType) class TestClimate(unittest.TestCase): diff --git a/test/config_test.py b/test/config_test.py index 01696ef7e..b213ce64c 100644 --- a/test/config_test.py +++ b/test/config_test.py @@ -3,8 +3,8 @@ import unittest from xknx import XKNX -from xknx.devices import (Action, BinarySensor, Climate, Cover, Light, - Notification, Sensor, Switch, DateTime) +from xknx.devices import (Action, BinarySensor, Climate, Cover, DateTime, + Light, Notification, Sensor, Switch) from xknx.devices.datetime import DateTimeBroadcastType diff --git a/test/cover_test.py b/test/cover_test.py index ccea06db1..0065fed46 100644 --- a/test/cover_test.py +++ b/test/cover_test.py @@ -6,7 +6,7 @@ from xknx import XKNX from xknx.devices import Cover -from xknx.knx import GroupAddress, DPTArray, DPTBinary, Telegram, TelegramType +from xknx.knx import DPTArray, DPTBinary, GroupAddress, Telegram, TelegramType class TestCover(unittest.TestCase): diff --git a/test/datetime_test.py b/test/datetime_test.py index 454553039..8fe094ecb 100644 --- a/test/datetime_test.py +++ b/test/datetime_test.py @@ -9,7 +9,6 @@ from xknx.devices.datetime import DateTimeBroadcastType from xknx.knx import GroupAddress, TelegramType - MOCK_LOCALTIME = Mock() # Mocked time: 2017-01-07 09:13:14 - a Saturday MOCK_LOCALTIME.return_value = time.struct_time([2017, 1, 7, 9, 13, 14, 6, 0, 0]) diff --git a/test/dpt_4byte_test.py b/test/dpt_4byte_test.py index ce3142971..f61dcbb95 100644 --- a/test/dpt_4byte_test.py +++ b/test/dpt_4byte_test.py @@ -2,8 +2,7 @@ import unittest from xknx.exceptions import ConversionError -from xknx.knx import DPT4ByteUnsigned -from xknx.knx import DPT4ByteSigned +from xknx.knx import DPT4ByteSigned, DPT4ByteUnsigned class TestDPT4Byte(unittest.TestCase): diff --git a/test/dpt_float_test.py b/test/dpt_float_test.py index 982e8be17..a229999e9 100644 --- a/test/dpt_float_test.py +++ b/test/dpt_float_test.py @@ -2,8 +2,9 @@ import unittest from xknx.exceptions import ConversionError -from xknx.knx import DPT2ByteFloat, DPT4ByteFloat, DPTHumidity, DPTLux, DPTTemperature, DPTElectricPotential, \ - DPTElectricCurrent, DPTPower, DPTFrequency, DPTPhaseAngleDeg +from xknx.knx import (DPT2ByteFloat, DPT4ByteFloat, DPTElectricCurrent, + DPTElectricPotential, DPTFrequency, DPTHumidity, DPTLux, + DPTPhaseAngleDeg, DPTPower, DPTTemperature) class TestDPTFloat(unittest.TestCase): diff --git a/test/knxip_routing_indication_test.py b/test/knxip_routing_indication_test.py index 3e67245c3..6658b2bbb 100644 --- a/test/knxip_routing_indication_test.py +++ b/test/knxip_routing_indication_test.py @@ -3,8 +3,8 @@ import unittest from xknx import XKNX -from xknx.knx import (GroupAddress, PhysicalAddress, DPTArray, DPTBinary, DPTTemperature, DPTTime, - Telegram, TelegramType) +from xknx.knx import (DPTArray, DPTBinary, DPTTemperature, DPTTime, + GroupAddress, PhysicalAddress, Telegram, TelegramType) from xknx.knxip import CEMIFrame, KNXIPFrame, KNXIPServiceType diff --git a/test/knxip_tunnelling_request_test.py b/test/knxip_tunnelling_request_test.py index 69e59c1f5..75f9ef8a5 100644 --- a/test/knxip_tunnelling_request_test.py +++ b/test/knxip_tunnelling_request_test.py @@ -3,7 +3,7 @@ import unittest from xknx import XKNX -from xknx.knx import GroupAddress, DPTBinary, Telegram +from xknx.knx import DPTBinary, GroupAddress, Telegram from xknx.knxip import (CEMIFrame, KNXIPFrame, KNXIPServiceType, TunnellingRequest) diff --git a/test/light_test.py b/test/light_test.py index 67d29d1c2..fa148811b 100644 --- a/test/light_test.py +++ b/test/light_test.py @@ -5,7 +5,7 @@ from xknx import XKNX from xknx.devices import Light -from xknx.knx import GroupAddress, DPTArray, DPTBinary, Telegram, TelegramType +from xknx.knx import DPTArray, DPTBinary, GroupAddress, Telegram, TelegramType class TestLight(unittest.TestCase): diff --git a/test/sensor_test.py b/test/sensor_test.py index d27612ae1..d0fc62965 100644 --- a/test/sensor_test.py +++ b/test/sensor_test.py @@ -5,7 +5,7 @@ from xknx import XKNX from xknx.devices import Sensor -from xknx.knx import GroupAddress, DPTArray, DPTBinary, Telegram, TelegramType +from xknx.knx import DPTArray, DPTBinary, GroupAddress, Telegram, TelegramType class TestSensor(unittest.TestCase): diff --git a/test/str_test.py b/test/str_test.py index e67757cf3..f65309574 100644 --- a/test/str_test.py +++ b/test/str_test.py @@ -4,12 +4,13 @@ from xknx import XKNX from xknx.devices import (Action, ActionBase, ActionCallback, BinarySensor, - Climate, Cover, Light, Notification, RemoteValue, - Sensor, Switch, DateTime) + Climate, Cover, DateTime, Light, Notification, + RemoteValue, Sensor, Switch) from xknx.exceptions import (ConversionError, CouldNotParseAddress, CouldNotParseKNXIP, CouldNotParseTelegram, DeviceIllegalValue) -from xknx.knx import GroupAddress, DPTArray, DPTBinary, Telegram, PhysicalAddress +from xknx.knx import (DPTArray, DPTBinary, GroupAddress, PhysicalAddress, + Telegram) from xknx.knxip import (HPAI, CEMIFrame, ConnectionStateRequest, ConnectionStateResponse, ConnectRequest, ConnectRequestType, ConnectResponse, diff --git a/test/switch_test.py b/test/switch_test.py index a95e95666..4d4261172 100644 --- a/test/switch_test.py +++ b/test/switch_test.py @@ -5,7 +5,7 @@ from xknx import XKNX from xknx.devices import Switch -from xknx.knx import GroupAddress, DPTBinary, Telegram, TelegramType +from xknx.knx import DPTBinary, GroupAddress, Telegram, TelegramType class TestSwitch(unittest.TestCase): diff --git a/test/telegram_received_cb_test.py b/test/telegram_received_cb_test.py index 465878900..4c3d1e2c7 100644 --- a/test/telegram_received_cb_test.py +++ b/test/telegram_received_cb_test.py @@ -4,7 +4,7 @@ from unittest.mock import Mock from xknx import XKNX -from xknx.knx import (GroupAddress, AddressFilter, DPTBinary, Telegram, +from xknx.knx import (AddressFilter, DPTBinary, GroupAddress, Telegram, TelegramDirection) diff --git a/xknx/core/config.py b/xknx/core/config.py index f23d3dc8f..38da72227 100644 --- a/xknx/core/config.py +++ b/xknx/core/config.py @@ -7,8 +7,8 @@ import yaml -from xknx.devices import (BinarySensor, Climate, Cover, Light, Notification, - Sensor, Switch, DateTime) +from xknx.devices import (BinarySensor, Climate, Cover, DateTime, Light, + Notification, Sensor, Switch) from xknx.knx import PhysicalAddress diff --git a/xknx/devices/binary_sensor.py b/xknx/devices/binary_sensor.py index 96377fb52..d7da442fc 100644 --- a/xknx/devices/binary_sensor.py +++ b/xknx/devices/binary_sensor.py @@ -8,8 +8,8 @@ A BinarySensor may also have Actions attached which are executed after state was changed. """ -import time import asyncio +import time from enum import Enum from xknx.exceptions import CouldNotParseTelegram diff --git a/xknx/devices/climate.py b/xknx/devices/climate.py index 4d76b7025..3ec9d8d54 100644 --- a/xknx/devices/climate.py +++ b/xknx/devices/climate.py @@ -5,8 +5,8 @@ * Manages and sends the desired setpoint to KNX bus. """ from xknx.exceptions import CouldNotParseTelegram, DeviceIllegalValue -from xknx.knx import (GroupAddress, DPTArray, DPTBinary, DPTControllerStatus, - DPTHVACMode, HVACOperationMode) +from xknx.knx import (DPTArray, DPTBinary, DPTControllerStatus, DPTHVACMode, + GroupAddress, HVACOperationMode) from .device import Device from .remote_value import RemoteValue1Count, RemoteValueTemp diff --git a/xknx/devices/datetime.py b/xknx/devices/datetime.py index 2005a2cbc..973adeadc 100644 --- a/xknx/devices/datetime.py +++ b/xknx/devices/datetime.py @@ -7,7 +7,9 @@ """ from enum import Enum -from xknx.knx import GroupAddress, DPTArray, DPTDateTime, DPTTime, DPTDate + +from xknx.knx import DPTArray, DPTDate, DPTDateTime, DPTTime, GroupAddress + from .device import Device diff --git a/xknx/devices/light.py b/xknx/devices/light.py index 72adff646..2bdab4aaa 100644 --- a/xknx/devices/light.py +++ b/xknx/devices/light.py @@ -8,7 +8,7 @@ * reading the current state from KNX bus. """ from xknx.exceptions import CouldNotParseTelegram -from xknx.knx import GroupAddress, DPTArray +from xknx.knx import DPTArray, GroupAddress from .device import Device from .remote_value import RemoteValueSwitch1001 diff --git a/xknx/devices/notification.py b/xknx/devices/notification.py index feb8f899f..e96e592e8 100644 --- a/xknx/devices/notification.py +++ b/xknx/devices/notification.py @@ -1,6 +1,6 @@ """Module for managing a notification via KNX.""" from xknx.exceptions import CouldNotParseTelegram -from xknx.knx import GroupAddress, DPTArray, DPTString +from xknx.knx import DPTArray, DPTString, GroupAddress from .device import Device diff --git a/xknx/devices/remote_value.py b/xknx/devices/remote_value.py index 9e308edb7..03ade6841 100644 --- a/xknx/devices/remote_value.py +++ b/xknx/devices/remote_value.py @@ -8,8 +8,8 @@ from enum import Enum from xknx.exceptions import ConversionError, CouldNotParseTelegram -from xknx.knx import (GroupAddress, DPTArray, DPTBinary, DPTScaling, DPTTemperature, - DPTValue1Count, Telegram) +from xknx.knx import (DPTArray, DPTBinary, DPTScaling, DPTTemperature, + DPTValue1Count, GroupAddress, Telegram) class RemoteValue(): diff --git a/xknx/devices/sensor.py b/xknx/devices/sensor.py index b67958336..1eb9e2eab 100644 --- a/xknx/devices/sensor.py +++ b/xknx/devices/sensor.py @@ -6,12 +6,13 @@ * reading the current state from KNX bus. * watching for state updates from KNX bus. """ -from xknx.knx import (GroupAddress, DPTArray, DPTBinary, DPTHumidity, DPTLux, - DPTScaling, DPTTemperature, DPTElectricPotential, - DPTElectricCurrent, DPTPower, DPTUElCurrentmA, DPTWsp, - DPTBrightness, DPTEnergy, DPTHeatFlowRate, DPTFrequency, DPTPhaseAngleRad, DPTPhaseAngleDeg, - DPTPowerFactor, DPTSpeed, - DPT2ByteUnsigned, DPT2ByteFloat, DPT4ByteUnsigned, DPT4ByteSigned, DPT4ByteFloat) +from xknx.knx import (DPT2ByteFloat, DPT2ByteUnsigned, DPT4ByteFloat, + DPT4ByteSigned, DPT4ByteUnsigned, DPTArray, DPTBinary, + DPTBrightness, DPTElectricCurrent, DPTElectricPotential, + DPTEnergy, DPTFrequency, DPTHeatFlowRate, DPTHumidity, + DPTLux, DPTPhaseAngleDeg, DPTPhaseAngleRad, DPTPower, + DPTPowerFactor, DPTScaling, DPTSpeed, DPTTemperature, + DPTUElCurrentmA, DPTWsp, GroupAddress) from .device import Device diff --git a/xknx/knx/address.py b/xknx/knx/address.py index 592de8cfe..7ba54f39c 100644 --- a/xknx/knx/address.py +++ b/xknx/knx/address.py @@ -12,8 +12,8 @@ * 2nd level: "1/2" * Free format: "123" """ -from re import compile as re_compile from enum import Enum +from re import compile as re_compile from xknx.exceptions import CouldNotParseAddress diff --git a/xknx/knx/dpt.py b/xknx/knx/dpt.py index b6e2416eb..9a1e40176 100644 --- a/xknx/knx/dpt.py +++ b/xknx/knx/dpt.py @@ -1,5 +1,6 @@ """Implementation of Basic KNX datatypes.""" from enum import Enum + from xknx.exceptions import ConversionError diff --git a/xknx/knx/dpt_4byte.py b/xknx/knx/dpt_4byte.py index a6f5abc4c..491eacc25 100644 --- a/xknx/knx/dpt_4byte.py +++ b/xknx/knx/dpt_4byte.py @@ -7,6 +7,7 @@ """ import struct + from xknx.exceptions import ConversionError from .dpt import DPTBase diff --git a/xknx/knx/dpt_datetime.py b/xknx/knx/dpt_datetime.py index 316acdea2..bab95fd5d 100644 --- a/xknx/knx/dpt_datetime.py +++ b/xknx/knx/dpt_datetime.py @@ -3,8 +3,8 @@ import time from xknx.exceptions import ConversionError -from .dpt import DPTBase -from .dpt import DPTWeekday + +from .dpt import DPTBase, DPTWeekday class DPTDateTime(DPTBase): diff --git a/xknx/knx/dpt_float.py b/xknx/knx/dpt_float.py index aca985ade..d72b58abb 100644 --- a/xknx/knx/dpt_float.py +++ b/xknx/knx/dpt_float.py @@ -7,6 +7,7 @@ """ import struct + from xknx.exceptions import ConversionError from .dpt import DPTBase diff --git a/xknx/knx/dpt_hvac_mode.py b/xknx/knx/dpt_hvac_mode.py index 5d2bf0382..ecad9e061 100644 --- a/xknx/knx/dpt_hvac_mode.py +++ b/xknx/knx/dpt_hvac_mode.py @@ -1,7 +1,9 @@ """Implementation of different KNX DPT HVAC Operation modes.""" from enum import Enum + from xknx.exceptions import CouldNotParseKNXIP + from .dpt import DPTBase diff --git a/xknx/knx/dpt_time.py b/xknx/knx/dpt_time.py index aaca885c3..5cd6fd7ed 100644 --- a/xknx/knx/dpt_time.py +++ b/xknx/knx/dpt_time.py @@ -4,8 +4,7 @@ from xknx.exceptions import ConversionError -from .dpt import DPTBase -from .dpt import DPTWeekday +from .dpt import DPTBase, DPTWeekday class DPTTime(DPTBase): diff --git a/xknx/knxip/cemi_frame.py b/xknx/knxip/cemi_frame.py index 45ea4fb0c..8d8d13bec 100644 --- a/xknx/knxip/cemi_frame.py +++ b/xknx/knxip/cemi_frame.py @@ -12,7 +12,7 @@ File: AN117 v02.01 KNX IP Communication Medium DV.pdf """ from xknx.exceptions import ConversionError, CouldNotParseKNXIP -from xknx.knx import (GroupAddress, PhysicalAddress, DPTArray, DPTBinary, +from xknx.knx import (DPTArray, DPTBinary, GroupAddress, PhysicalAddress, Telegram, TelegramType) from .body import KNXIPBody