Skip to content

Commit

Permalink
typos and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
farmio committed Dec 10, 2020
1 parent 6fad017 commit dd4ef04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions xknx/io/tunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def init_udp_client(self):
)

self.udp_client.register_callback(
self._reqest_received,
self._request_received,
[KNXIPServiceType.TUNNELLING_REQUEST, KNXIPServiceType.DISCONNECT_REQUEST],
)

Expand Down Expand Up @@ -243,7 +243,7 @@ def _increase_sequence_number(self):
#
####################

def _reqest_received(self, knxipframe, _udp_client):
def _request_received(self, knxipframe, _udp_client):
"""Handle incoming requests."""
# pylint: disable=unused-argument
if knxipframe.header.service_type_ident is KNXIPServiceType.TUNNELLING_REQUEST:
Expand Down Expand Up @@ -323,4 +323,4 @@ async def _do_heartbeat_failed(self):
return
# 3 retries failed
logger.warning("Heartbeat to KNX bus failed. Reconnecting.")
await self._tunnel_lost()
self._tunnel_lost()
6 changes: 2 additions & 4 deletions xknx/io/udp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ def datagram_received(self, data, addr):

def error_received(self, exc):
"""Handle errors. Callback for error received."""
if hasattr(self, "xknx"):
logger.warning("Error received: %s", exc)
logger.warning("Error received: %s", exc)

def connection_lost(self, exc):
"""Log error. Callback for connection lost."""
if hasattr(self, "xknx") and exc is not None:
logger.info("Closing transport.")
logger.debug("Closing transport.")

def __init__(
self,
Expand Down

0 comments on commit dd4ef04

Please sign in to comment.