Skip to content

Commit

Permalink
Merge branch 'master' of github.com:XKNX/xknx
Browse files Browse the repository at this point in the history
  • Loading branch information
Julius2342 committed Dec 23, 2018
2 parents 79aff89 + 142ea54 commit eab6bc4
Show file tree
Hide file tree
Showing 70 changed files with 165 additions and 159 deletions.
2 changes: 2 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[settings]
multi_line_output=4
7 changes: 3 additions & 4 deletions home-assistant-plugin/custom_components/binary_sensor/xknx.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
https://home-assistant.io/components/binary_sensor.knx/
"""

import homeassistant.helpers.config_validation as cv
import voluptuous as vol

from homeassistant.components.binary_sensor import (
PLATFORM_SCHEMA, BinarySensorDevice)
from custom_components.xknx import (
ATTR_DISCOVER_DEVICES, DATA_XKNX, KNXAutomation)
from homeassistant.components.binary_sensor import (
PLATFORM_SCHEMA, BinarySensorDevice)
from homeassistant.const import CONF_NAME
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv

CONF_ADDRESS = 'address'
CONF_DEVICE_CLASS = 'device_class'
Expand Down
7 changes: 4 additions & 3 deletions home-assistant-plugin/custom_components/climate/xknx.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
import voluptuous as vol
from custom_components.xknx import ATTR_DISCOVER_DEVICES, DATA_XKNX
from homeassistant.components.climate import (
PLATFORM_SCHEMA, SUPPORT_OPERATION_MODE, SUPPORT_TARGET_TEMPERATURE,
SUPPORT_ON_OFF, ClimateDevice)
from homeassistant.const import ATTR_TEMPERATURE, CONF_NAME, TEMP_CELSIUS, STATE_UNKNOWN
PLATFORM_SCHEMA, SUPPORT_ON_OFF, SUPPORT_OPERATION_MODE,
SUPPORT_TARGET_TEMPERATURE, ClimateDevice)
from homeassistant.const import (
ATTR_TEMPERATURE, CONF_NAME, STATE_UNKNOWN, TEMP_CELSIUS)
from homeassistant.core import callback

CONF_SETPOINT_SHIFT_ADDRESS = 'setpoint_shift_address'
Expand Down
5 changes: 2 additions & 3 deletions home-assistant-plugin/custom_components/cover/xknx.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
https://home-assistant.io/components/cover.knx/
"""

import homeassistant.helpers.config_validation as cv
import voluptuous as vol

from custom_components.xknx import ATTR_DISCOVER_DEVICES, DATA_XKNX
from homeassistant.components.cover import (
ATTR_POSITION, ATTR_TILT_POSITION, PLATFORM_SCHEMA, SUPPORT_CLOSE,
SUPPORT_OPEN, SUPPORT_SET_POSITION, SUPPORT_SET_TILT_POSITION,
SUPPORT_STOP, CoverDevice)
from custom_components.xknx import ATTR_DISCOVER_DEVICES, DATA_XKNX
from homeassistant.const import CONF_NAME
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import async_track_utc_time_change

CONF_MOVE_LONG_ADDRESS = 'move_long_address'
Expand Down
5 changes: 2 additions & 3 deletions home-assistant-plugin/custom_components/light/xknx.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
https://home-assistant.io/components/light.knx/
"""

import homeassistant.helpers.config_validation as cv
import homeassistant.util.color as color_util
import voluptuous as vol

from custom_components.xknx import ATTR_DISCOVER_DEVICES, DATA_XKNX
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_HS_COLOR, PLATFORM_SCHEMA, SUPPORT_BRIGHTNESS,
SUPPORT_COLOR, Light)
from homeassistant.const import CONF_NAME
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
import homeassistant.util.color as color_util

CONF_ADDRESS = 'address'
CONF_STATE_ADDRESS = 'state_address'
Expand Down
9 changes: 4 additions & 5 deletions home-assistant-plugin/custom_components/notify/xknx.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
https://home-assistant.io/components/notify.knx/
"""

import homeassistant.helpers.config_validation as cv
import voluptuous as vol

from custom_components.xknx import DATA_XKNX, ATTR_DISCOVER_DEVICES
from homeassistant.components.notify import PLATFORM_SCHEMA, \
BaseNotificationService
from custom_components.xknx import ATTR_DISCOVER_DEVICES, DATA_XKNX
from homeassistant.components.notify import (
PLATFORM_SCHEMA, BaseNotificationService)
from homeassistant.const import CONF_NAME
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv

CONF_ADDRESS = 'address'
DEFAULT_NAME = 'XKNX Notify'
Expand Down
3 changes: 1 addition & 2 deletions home-assistant-plugin/custom_components/scene/xknx.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/scene.knx/
"""
import homeassistant.helpers.config_validation as cv
import voluptuous as vol

from custom_components.xknx import ATTR_DISCOVER_DEVICES, DATA_XKNX
from homeassistant.components.scene import CONF_PLATFORM, Scene
from homeassistant.const import CONF_NAME
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv

CONF_ADDRESS = 'address'
CONF_SCENE_NUMBER = 'scene_number'
Expand Down
3 changes: 1 addition & 2 deletions home-assistant-plugin/custom_components/sensor/xknx.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
https://home-assistant.io/components/sensor.knx/
"""

import homeassistant.helpers.config_validation as cv
import voluptuous as vol

from custom_components.xknx import ATTR_DISCOVER_DEVICES, DATA_XKNX
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity

CONF_ADDRESS = 'address'
Expand Down
3 changes: 1 addition & 2 deletions home-assistant-plugin/custom_components/switch/xknx.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
https://home-assistant.io/components/switch.knx/
"""

import homeassistant.helpers.config_validation as cv
import voluptuous as vol

from custom_components.xknx import ATTR_DISCOVER_DEVICES, DATA_XKNX
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
from homeassistant.const import CONF_NAME
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv

CONF_ADDRESS = 'address'
CONF_STATE_ADDRESS = 'state_address'
Expand Down
3 changes: 1 addition & 2 deletions home-assistant-plugin/custom_components/xknx.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@

import logging

import homeassistant.helpers.config_validation as cv
import voluptuous as vol

from homeassistant.const import (
CONF_ENTITY_ID, CONF_HOST, CONF_PORT, EVENT_HOMEASSISTANT_STOP)
from homeassistant.core import callback
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import async_track_state_change
from homeassistant.helpers.script import Script

Expand Down
2 changes: 0 additions & 2 deletions requirements/development.txt

This file was deleted.

16 changes: 9 additions & 7 deletions requirements/testing.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
-r production.txt
coveralls==1.5.0
flake8==3.5.0
isort==4.3.4
coveralls==1.5.1
flake8==3.6.0
flake8-isort==2.6.0
pydocstyle==2.1.1
pylint==2.1.1
pytest==3.8.1
pylint==2.2.2
pytest==4.0.2
pytest-cov==2.6.0
pytest-timeout==1.3.2
setuptools==40.4.2
tox==3.4.0
pytest-timeout==1.3.3
setuptools==40.6.3
tox==3.6.0
3 changes: 2 additions & 1 deletion test/action_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from unittest.mock import Mock, patch

from xknx import XKNX
from xknx.devices import ActionBase, Action, ActionCallback, BinarySensorState, Light
from xknx.devices import (
Action, ActionBase, ActionCallback, BinarySensorState, Light)


class TestAction(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test/address_filter_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Unit test for Address class."""
import unittest

from xknx.knx import AddressFilter, GroupAddress
from xknx.exceptions import ConversionError
from xknx.knx import AddressFilter, GroupAddress


class TestAddressFilter(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test/binary_sensor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from xknx import XKNX
from xknx.devices import Action, BinarySensor, BinarySensorState, Switch
from xknx.knx import DPTBinary, DPTArray, Telegram, GroupAddress
from xknx.exceptions import CouldNotParseTelegram
from xknx.knx import DPTArray, DPTBinary, GroupAddress, Telegram


class TestBinarySensor(unittest.TestCase):
Expand Down
10 changes: 5 additions & 5 deletions test/climate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

from xknx import XKNX
from xknx.devices import Climate, ClimateMode
from xknx.exceptions import DeviceIllegalValue, CouldNotParseTelegram
from xknx.knx import (DPT2ByteFloat, DPTArray, DPTBinary, DPTControllerStatus,
DPTHVACMode, DPTHVACContrMode, DPTTemperature, DPTValue1Count,
GroupAddress, HVACOperationMode, Telegram, TelegramType)

from xknx.exceptions import CouldNotParseTelegram, DeviceIllegalValue
from xknx.knx import (
DPT2ByteFloat, DPTArray, DPTBinary, DPTControllerStatus, DPTHVACContrMode,
DPTHVACMode, DPTTemperature, DPTValue1Count, GroupAddress,
HVACOperationMode, Telegram, TelegramType)

DPT_20102_MODES = [HVACOperationMode.AUTO, HVACOperationMode.COMFORT,
HVACOperationMode.STANDBY, HVACOperationMode.NIGHT,
Expand Down
7 changes: 4 additions & 3 deletions test/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
from unittest.mock import patch

from xknx import XKNX
from xknx.devices import (Action, BinarySensor, Climate, ClimateMode, Cover, DateTime,
ExposeSensor, Light, Notification, Scene, Sensor,
Switch, DateTimeBroadcastType)
from xknx.devices import (
Action, BinarySensor, Climate, ClimateMode, Cover, DateTime,
DateTimeBroadcastType, ExposeSensor, Light, Notification, Scene, Sensor,
Switch)
from xknx.exceptions import XKNXException


Expand Down
4 changes: 2 additions & 2 deletions test/device_test.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Unit test for Switch objects."""
import asyncio
import unittest
from unittest.mock import patch, Mock
from unittest.mock import Mock, patch

from xknx import XKNX
from xknx.devices import Device
from xknx.knx import DPTArray, GroupAddress, Telegram, TelegramType
from xknx.exceptions import XKNXException
from xknx.knx import DPTArray, GroupAddress, Telegram, TelegramType


class TestDevice(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test/devices_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from unittest.mock import Mock, patch

from xknx import XKNX
from xknx.devices import BinarySensor, Devices, Device, Light, Switch
from xknx.devices import BinarySensor, Device, Devices, Light, Switch
from xknx.knx import GroupAddress


Expand Down
2 changes: 1 addition & 1 deletion test/dpt_4byte_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Unit test for KNX 2 byte objects."""
import struct
import unittest
from unittest.mock import patch
import struct

from xknx.exceptions import ConversionError
from xknx.knx import DPT4ByteSigned, DPT4ByteUnsigned
Expand Down
10 changes: 5 additions & 5 deletions test/dpt_float_test.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""Unit test for KNX 2 and 4 byte float objects."""
import struct
import unittest
from unittest.mock import patch
import struct

from xknx.exceptions import ConversionError
from xknx.knx import (DPT2ByteFloat, DPT4ByteFloat, DPTElectricCurrent,
DPTElectricPotential, DPTFrequency, DPTHumidity, DPTLux,
DPTPhaseAngleDeg, DPTPower, DPTTemperature,
DPTEnthalpy, DPTPartsPerMillion, DPTVoltage)
from xknx.knx import (
DPT2ByteFloat, DPT4ByteFloat, DPTElectricCurrent, DPTElectricPotential,
DPTEnthalpy, DPTFrequency, DPTHumidity, DPTLux, DPTPartsPerMillion,
DPTPhaseAngleDeg, DPTPower, DPTTemperature, DPTVoltage)


class TestDPTFloat(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test/fan_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from xknx import XKNX
from xknx.devices import Fan
from xknx.knx import DPTArray, DPTBinary, GroupAddress, Telegram, TelegramType
from xknx.exceptions import CouldNotParseTelegram
from xknx.knx import DPTArray, DPTBinary, GroupAddress, Telegram, TelegramType


class TestFan(unittest.TestCase):
Expand Down
6 changes: 4 additions & 2 deletions test/io_connect_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
from unittest.mock import patch

from xknx import XKNX
from xknx.io import UDPClient, Connect
from xknx.knxip import ConnectResponse, KNXIPFrame, KNXIPServiceType, HPAI, ErrorCode, ConnectRequestType
from xknx.io import Connect, UDPClient
from xknx.knxip import (
HPAI, ConnectRequestType, ConnectResponse, ErrorCode, KNXIPFrame,
KNXIPServiceType)


class TestConnect(unittest.TestCase):
Expand Down
5 changes: 3 additions & 2 deletions test/io_connectionstate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
from unittest.mock import patch

from xknx import XKNX
from xknx.io import UDPClient, ConnectionState
from xknx.knxip import ConnectionStateResponse, KNXIPFrame, KNXIPServiceType, HPAI, ErrorCode
from xknx.io import ConnectionState, UDPClient
from xknx.knxip import (
HPAI, ConnectionStateResponse, ErrorCode, KNXIPFrame, KNXIPServiceType)


class TestConnectionState(unittest.TestCase):
Expand Down
5 changes: 3 additions & 2 deletions test/io_disconnect_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
from unittest.mock import patch

from xknx import XKNX
from xknx.io import UDPClient, Disconnect
from xknx.knxip import DisconnectResponse, KNXIPFrame, KNXIPServiceType, HPAI, ErrorCode
from xknx.io import Disconnect, UDPClient
from xknx.knxip import (
HPAI, DisconnectResponse, ErrorCode, KNXIPFrame, KNXIPServiceType)


class TestDisconnect(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test/io_request_response_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import unittest

from xknx import XKNX
from xknx.io import UDPClient, RequestResponse
from xknx.io import RequestResponse, UDPClient
from xknx.knxip import DisconnectResponse


Expand Down
6 changes: 3 additions & 3 deletions test/io_tunnelling_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from unittest.mock import patch

from xknx import XKNX
from xknx.io import UDPClient, Tunnelling
from xknx.knxip import TunnellingAck, KNXIPFrame, KNXIPServiceType, ErrorCode
from xknx.knx import Telegram, PhysicalAddress, GroupAddress, DPTArray
from xknx.io import Tunnelling, UDPClient
from xknx.knx import DPTArray, GroupAddress, PhysicalAddress, Telegram
from xknx.knxip import ErrorCode, KNXIPFrame, KNXIPServiceType, TunnellingAck


class TestTunnelling(unittest.TestCase):
Expand Down
4 changes: 2 additions & 2 deletions test/knxip_connect_request_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import unittest

from xknx import XKNX
from xknx.knxip import (HPAI, ConnectRequest, ConnectRequestType, KNXIPFrame,
KNXIPServiceType)
from xknx.exceptions import CouldNotParseKNXIP
from xknx.knxip import (
HPAI, ConnectRequest, ConnectRequestType, KNXIPFrame, KNXIPServiceType)


class Test_KNXIP_ConnectRequest(unittest.TestCase):
Expand Down
5 changes: 3 additions & 2 deletions test/knxip_connect_response_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import unittest

from xknx import XKNX
from xknx.knxip import (HPAI, ConnectRequestType, ConnectResponse, ErrorCode,
KNXIPFrame, KNXIPServiceType)
from xknx.exceptions import CouldNotParseKNXIP
from xknx.knxip import (
HPAI, ConnectRequestType, ConnectResponse, ErrorCode, KNXIPFrame,
KNXIPServiceType)


class Test_KNXIP_ConnectResponse(unittest.TestCase):
Expand Down
4 changes: 2 additions & 2 deletions test/knxip_connectionstate_request_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import unittest

from xknx import XKNX
from xknx.knxip import (HPAI, ConnectionStateRequest, KNXIPFrame,
KNXIPServiceType)
from xknx.exceptions import CouldNotParseKNXIP
from xknx.knxip import (
HPAI, ConnectionStateRequest, KNXIPFrame, KNXIPServiceType)


class Test_KNXIP_ConnStateReq(unittest.TestCase):
Expand Down
Loading

0 comments on commit eab6bc4

Please sign in to comment.