Skip to content

Commit

Permalink
Fix TypeError when comparing Telegrams when specifying own_address wi…
Browse files Browse the repository at this point in the history
…thin xknx.yaml.
  • Loading branch information
Julius2342 committed Dec 20, 2020
1 parent 30720c7 commit 8ff9853
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion test/config_tests/config_v1_test.py
Expand Up @@ -23,6 +23,7 @@
)
from xknx.exceptions import XKNXException
from xknx.io import ConnectionConfig, ConnectionType
from xknx.telegram import IndividualAddress
import yaml


Expand Down Expand Up @@ -54,7 +55,7 @@ def tearDownClass(cls):
#
def test_config_general(self):
"""Test reading general section from config file."""
self.assertEqual(TestConfig.xknx.own_address, "15.15.249")
self.assertEqual(TestConfig.xknx.own_address, IndividualAddress("15.15.249"))
self.assertEqual(TestConfig.xknx.rate_limit, 18)
self.assertEqual(TestConfig.xknx.multicast_group, "224.1.2.3")
self.assertEqual(TestConfig.xknx.multicast_port, 1337)
Expand Down
3 changes: 2 additions & 1 deletion xknx/config/config_v1.py
Expand Up @@ -23,6 +23,7 @@
)
from xknx.exceptions import XKNXException
from xknx.io import ConnectionConfig, ConnectionType
from xknx.telegram import IndividualAddress

logger = logging.getLogger("xknx.log")

Expand Down Expand Up @@ -51,7 +52,7 @@ def parse_general(self, doc):
"""Parse the general section of xknx.yaml."""
if "general" in doc:
if "own_address" in doc["general"]:
self.xknx.own_address = doc["general"]["own_address"]
self.xknx.own_address = IndividualAddress(doc["general"]["own_address"])
if "rate_limit" in doc["general"]:
self.xknx.rate_limit = doc["general"]["rate_limit"]
if "multicast_group" in doc["general"]:
Expand Down

0 comments on commit 8ff9853

Please sign in to comment.