Skip to content

add aioartnet.listen tool#13

Merged
shuckc merged 2 commits intomainfrom
add-listener
Jun 29, 2025
Merged

add aioartnet.listen tool#13
shuckc merged 2 commits intomainfrom
add-listener

Conversation

@shuckc
Copy link
Copy Markdown
Member

@shuckc shuckc commented Jun 29, 2025

Using prompt_toolkit

Copilot AI review requested due to automatic review settings June 29, 2025 21:33

This comment was marked as outdated.

@shuckc shuckc force-pushed the add-listener branch 2 times, most recently from 521ccf2 to 4246a97 Compare June 29, 2025 21:47
@shuckc shuckc requested a review from Copilot June 29, 2025 21:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new interactive CLI tool (aioartnet.listen) that uses prompt_toolkit to display Art-Net universe data and event history in a full-screen terminal UI.

  • Introduces listen.py with an async main function that connects to ArtNetClient, handles incoming events, and updates a live prompt UI.
  • Parses command-line arguments for network interface, port name, and universes to view.
  • Binds a “q” key to exit and maintains a scrolling history of non-DMX events.
Comments suppressed due to low confidence (4)

aioartnet/listen.py:21

  • [nitpick] The variable dmxstr is not PEP8-compliant and is unclear; consider renaming it to dmx_str or universe_display_str for better readability.
    dmxstr = "Waiting for DMX data"

aioartnet/listen.py:20

  • [nitpick] Public function main lacks a docstring. Add one summarizing its purpose, parameters, and expected behavior.
async def main(client: ArtNetClient) -> None:

aioartnet/listen.py:20

  • The new CLI functionality in main has no test coverage; consider adding tests for argument parsing, event handling, and UI exit conditions.
async def main(client: ArtNetClient) -> None:

aioartnet/listen.py:118

  • You're checking args.portName but the argument parser defines --port-name, so the attribute is args.port_name. Update this to avoid an AttributeError.
    if args.portName:

Comment thread aioartnet/listen.py
await application.run_async()

# Cancel event listener
task.cancel()
Copy link

Copilot AI Jun 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ArtNetClient connection is never closed after cancelling the event listener; consider calling await client.disconnect() (or the appropriate cleanup method) to properly release network resources.

Copilot uses AI. Check for mistakes.
@shuckc shuckc merged commit ddacdcb into main Jun 29, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants