Skip to content

Add syslog identification on connect#21

Merged
SteveEasley merged 2 commits intoSteveEasley:mainfrom
robotdan:worktree-issue-1-syslog-identification
Apr 5, 2026
Merged

Add syslog identification on connect#21
SteveEasley merged 2 commits intoSteveEasley:mainfrom
robotdan:worktree-issue-1-syslog-identification

Conversation

@robotdan
Copy link
Copy Markdown
Contributor

@robotdan robotdan commented Apr 4, 2026

Summary

  • Sends SEND_TO_SYSLOG:INFORMATION:pykaleidescape version X.Y.Z: during Device.connect() to register the module in the Kaleidescape system log
  • This follows the convention documented on page 59 of the Kaleidescape Control Protocol Reference Manual and is included in all official Kaleidescape control modules
  • Enables Kaleidescape Support to identify connected third-party controllers when troubleshooting

Closes #1

Changes

  • const.py: Add SEND_TO_SYSLOG constant
  • message.py: Add SendToSyslog request class
  • device.py: Call SEND_TO_SYSLOG at end of Device.connect()
  • tests/emulator.py: Add received_requests tracking, register mock handler for SEND_TO_SYSLOG
  • tests/test_d_device.py: Add test_connect_sends_syslog_identification verifying the command is sent with correct fields

robotdan and others added 2 commits April 4, 2026 13:19
Send SEND_TO_SYSLOG command during Device.connect() to register
pykaleidescape in the Kaleidescape system log, enabling support
troubleshooting per the Control Protocol Reference Manual (p. 59).

Closes SteveEasley#1

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verify that Device.connect() sends the SEND_TO_SYSLOG command with the
correct module name and version string.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@robotdan robotdan mentioned this pull request Apr 4, 2026
Copy link
Copy Markdown
Owner

@SteveEasley SteveEasley left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Thanks for closing that one out!

@SteveEasley SteveEasley merged commit 18339af into SteveEasley:main Apr 5, 2026
4 checks passed
robotdan added a commit to robotdan/pykaleidescape that referenced this pull request Apr 6, 2026
PR SteveEasley#21 used importlib.metadata.version() to look up the package version at runtime for the syslog identification message. This fails with PackageNotFoundError in PyInstaller deployments because PyInstaller strips dist-info metadata by default.

kaleidescape.__version__ is the actual source of truth for the version (pyproject.toml reads from it via setuptools.dynamic), and works in all environments — pip installs, git URL installs, and PyInstaller bundles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
robotdan added a commit to robotdan/pykaleidescape that referenced this pull request Apr 6, 2026
PR SteveEasley#21 used importlib.metadata.version() to look up the package version at runtime for the syslog identification message. This fails with PackageNotFoundError in PyInstaller deployments because PyInstaller strips dist-info metadata by default.

kaleidescape.__version__ is the actual source of truth for the version (pyproject.toml reads from it via setuptools.dynamic), and works in all environments — pip installs, git URL installs, and PyInstaller bundles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SteveEasley pushed a commit that referenced this pull request May 6, 2026
PR #18 (Refresh device state after auto-reconnect) added two tests that
wait on `connect_signal` (STATE_CONNECTED) after the initial connect.
PR #19 (Dispatch STATE_CONNECTED only on auto-reconnect) then moved the
STATE_CONNECTED dispatch out of `_connect()` and into `_reconnect()`.
PR #19 updated other tests with the same pattern, but #19 was opened
before #18 merged, so the two tests added by #18 weren't updated.

Result: `await connect_signal.wait()` after initial connect waits
forever, hanging CI for the full 6h job timeout. Every CI run on main
since #18 has been cancelled this way (#19, #20, #21, v1.1.6, #22).

Match the pattern used by other tests updated in #19: assert
`state == STATE_CONNECTED` directly after the initial connect, and
keep `connect_signal.wait()` only for the post-reconnect signal where
STATE_CONNECTED is actually dispatched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Add syslog identification

2 participants