Skip to content

Commit

Permalink
Merge branch 'main' into feature/dtop_python_3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-w committed Mar 29, 2021
2 parents 0ff1230 + 87d20e3 commit 820fa7c
Show file tree
Hide file tree
Showing 114 changed files with 186 additions and 3,240 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Expand Up @@ -4,6 +4,10 @@

- Drop support for python 3.7

### HA integration

- Add experimental (opt-in) support for unique ids

## 0.17.4 Bugfix for ValueReader 2021-03-26

### Internals
Expand Down
3 changes: 3 additions & 0 deletions docs/configuration.md
Expand Up @@ -7,6 +7,9 @@ has_children: true

# Configuration

NOTE: Using `xknx.yaml` is no longer supported and the functionality will be removed in a future version. Instead, please
use standard python code or (if you are using Home Assistant) simply use the Home Assistant configuration to configure your KNX devices.

## Overview

XKNX is controlled via a configuration file. Per default the configuration file is named `xknx.yaml`.
Expand Down
3 changes: 3 additions & 0 deletions home-assistant-plugin/custom_components/xknx/__init__.py
Expand Up @@ -64,6 +64,7 @@
CONF_XKNX_MCAST_PORT = "multicast_port"
CONF_XKNX_STATE_UPDATER = "state_updater"
CONF_XKNX_RATE_LIMIT = "rate_limit"
CONF_XKNX_USE_UNIQUE_ID = "use_unique_id"
CONF_XKNX_EXPOSE = "expose"

SERVICE_XKNX_SEND = "send"
Expand Down Expand Up @@ -108,6 +109,7 @@
vol.Optional(CONF_XKNX_RATE_LIMIT, default=20): vol.All(
vol.Coerce(int), vol.Range(min=1, max=100)
),
vol.Optional(CONF_XKNX_USE_UNIQUE_ID, default=False): cv.boolean,
vol.Optional(CONF_XKNX_EXPOSE): vol.All(
cv.ensure_list, [ExposeSchema.SCHEMA]
),
Expand Down Expand Up @@ -301,6 +303,7 @@ def __init__(self, hass, config):
self.hass = hass
self.config = config
self.connected = False
self.use_unique_id = config[DOMAIN][CONF_XKNX_USE_UNIQUE_ID]
self.exposures = []
self.service_exposures = {}

Expand Down
8 changes: 8 additions & 0 deletions home-assistant-plugin/custom_components/xknx/knx_entity.py
Expand Up @@ -23,6 +23,14 @@ def available(self):
"""Return True if entity is available."""
return self.hass.data[DOMAIN].connected

@property
def unique_id(self):
"""Return the unique id of the device if enabled."""
if self.hass.data[DOMAIN].use_unique_id:
return self._device.unique_id

return None

@property
def should_poll(self):
"""No polling needed within KNX."""
Expand Down
6 changes: 1 addition & 5 deletions setup.cfg
Expand Up @@ -37,8 +37,4 @@ python_version = 3.8
strict = true
warn_unreachable = true
implicit_reexport = true
ignore_missing_imports = true

# untyped modules
[mypy-xknx.config.config_validation,xknx.config.objects,xknx.config.yaml_loader]
ignore_errors = true
ignore_missing_imports = true
9 changes: 0 additions & 9 deletions test/config_tests/config_v1_test.py
Expand Up @@ -122,15 +122,6 @@ def test_config_connection(self):
ConfigV1(TestConfig.xknx).parse_connection(config)
self.assertEqual(TestConfig.xknx.connection_config, expected_conn)

def test_version_2(self):
"""Test connection section from config file."""
# Replaces setting from xknx.yaml
test_config = """
version: 2
"""
config = yaml.safe_load(test_config)
self.assertRaises(NotImplementedError, Config(TestConfig.xknx).parse, config)

def test_config_invalid_connection(self):
"""Test invalid connection section from config file."""

Expand Down
10 changes: 0 additions & 10 deletions test/config_tests/resources/binary_sensor/invalid_1.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions test/config_tests/resources/binary_sensor/invalid_2.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions test/config_tests/resources/binary_sensor/invalid_3.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions test/config_tests/resources/binary_sensor/invalid_4.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions test/config_tests/resources/binary_sensor/invalid_5.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions test/config_tests/resources/binary_sensor/valid_1.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions test/config_tests/resources/binary_sensor/valid_2.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions test/config_tests/resources/binary_sensor/valid_3.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions test/config_tests/resources/binary_sensor/valid_4.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions test/config_tests/resources/climate/invalid_1.yaml

This file was deleted.

39 changes: 0 additions & 39 deletions test/config_tests/resources/climate/invalid_2.yaml

This file was deleted.

39 changes: 0 additions & 39 deletions test/config_tests/resources/climate/invalid_3.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions test/config_tests/resources/climate/valid_1.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions test/config_tests/resources/climate/valid_2.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions test/config_tests/resources/connection/invalid_1.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions test/config_tests/resources/connection/invalid_2.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions test/config_tests/resources/connection/invalid_3.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions test/config_tests/resources/connection/valid_1.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions test/config_tests/resources/connection/valid_2.yaml

This file was deleted.

1 change: 0 additions & 1 deletion test/config_tests/resources/connection/valid_3.yaml

This file was deleted.

0 comments on commit 820fa7c

Please sign in to comment.