Skip to content

Commit

Permalink
debugging tcp gateway problems
Browse files Browse the repository at this point in the history
  • Loading branch information
grimmpp committed Oct 16, 2024
1 parent 1348ddb commit ccf8e21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/eltako/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def _fire_received_message_count_event(self):
self._received_message_count_handler( self._received_message_count ),
)

def process_messages(self, data=None):
def report_message_stats(self, data=None):
"""Received message from bus in HA loop. (Actions needs to run outside bus thread!)"""
self._fire_received_message_count_event()
self._fire_last_message_received_event()
Expand Down Expand Up @@ -444,7 +444,7 @@ def _callback_receive_message_from_serial_bus(self, message:ESP2Message):

if type(message) not in [EltakoPoll]:
LOGGER.debug("[Gateway] [Id: %d] Received message: %s", self.dev_id, message)
self.process_messages()
self.report_message_stats()

if message.body[:2] == b'\x8b\x98':
LOGGER.debug("[Gateway] [Id: %d] Received base id: %s", self.dev_id, b2s(message.body[2:6]))
Expand All @@ -453,7 +453,7 @@ def _callback_receive_message_from_serial_bus(self, message:ESP2Message):


# only send messages to HA when base id is known
if self.base_id != b'\x00\x00\x00\x00' and isinstance(message, ESP2Message):
if self.base_id != b'\x00\x00\x00\x00':

# Send message on local bus. Only devices configure to this gateway will receive those message.
event_id = config_helpers.get_bus_event_type(self.dev_id, SIGNAL_RECEIVE_MESSAGE)
Expand Down

0 comments on commit ccf8e21

Please sign in to comment.