Skip to content

Commit

Permalink
more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Hoch committed Apr 29, 2024
1 parent 5f75bcd commit 3c085ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pyvlx/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from .api import SetNodeName
from .exception import PyVLXException
from .log import PYVLXLOG

if TYPE_CHECKING:
from pyvlx import PyVLX
Expand Down Expand Up @@ -37,6 +38,7 @@ def unregister_device_updated_cb(self, device_updated_cb: CallbackType) -> None:

async def after_update(self) -> None:
"""Execute callbacks after internal state has been changed."""
PYVLXLOG.debug("Node %r after update. Calling %d update listeners", self.node_id, len(self.device_updated_cbs))
for device_updated_cb in self.device_updated_cbs:
# pylint: disable=not-callable
self.pyvlx.loop.create_task(device_updated_cb(self)) # type: ignore
Expand Down
4 changes: 2 additions & 2 deletions pyvlx/pyvlx.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async def connect(self) -> None:

PYVLXLOG.debug("Connecting to KLF 200 was opened")
for node in self.nodes:
await self.loop.create_task(node.after_update())
await node.after_update()

async def reboot_gateway(self) -> None:
"""For Compatibility: Reboot the KLF 200."""
Expand Down Expand Up @@ -126,4 +126,4 @@ async def on_connection_closed_cb(self) -> None:
"""Handle KLF 200 closed connection callback."""
PYVLXLOG.debug("Connecting to KLF 200 was closed")
for node in self.nodes:
await self.loop.create_task(node.after_update())
await node.after_update()

0 comments on commit 3c085ae

Please sign in to comment.