Skip to content

Robustness for application/imagebytes and driverinfo retrieval to handle empty cases - #27

Closed
mworion wants to merge 2 commits into
ASCOMInitiative:masterfrom
mworion:master
Closed

Robustness for application/imagebytes and driverinfo retrieval to handle empty cases#27
mworion wants to merge 2 commits into
ASCOMInitiative:masterfrom
mworion:master

Conversation

@mworion

@mworion mworion commented May 26, 2026

Copy link
Copy Markdown

First, many thanks for this nice package. I move completely to this solution recently in my application.

aded the imagebytes topic as well…

I interface with NINA (as they offer all devices as ALPACA devices through a plugin).
In case of some devices they are not filling the device.info field. The conformance checker does not raise an issue about it.

If there is no field populated, get will return NONE. From implementation this could happen.
If doing a split to none, python raises an exception. This could be corrected by giving a default value of an empty string.

If an empty device.info is right or incorrect I do not address, simply only the robustness of the python implementation.

Michel

Copilot AI review requested due to automatic review settings May 26, 2026 07:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates DriverInfo to provide a default value when the driverinfo field is missing, avoiding errors from calling .split() on None.

Changes:

  • Adds a default empty-string fallback to self._get("driverinfo", "") in DriverInfo.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread alpaca/device.py
@mworion

mworion commented Aug 16, 2026

Copy link
Copy Markdown
Author

Hi, is there any chance to review my proposal ? This would lower unnecessary error logging in my app.
Many thanks,
Michel

@mworion mworion changed the title Fix driverinfo retrieval to handle empty cases Robustness for application/imagebytes and driverinfo retrieval to handle empty cases Aug 18, 2026
@mworion

mworion commented Aug 18, 2026

Copy link
Copy Markdown
Author

Adding the camera application/imagebytes fix

@BobDenny

Copy link
Copy Markdown
Collaborator

As a result of our conversation on ASCOM Developer Help, I had already made the changes to camera.py locally, committed to my local repo and run the unit tests. I appreciate the PR. I'll apply the other simple fix to device.py locally as well, re-run the unit tests, and once I have it all finished, commit the next release here. I work alone so I don't push and branch here. It's just more work and chances for errors.

Thank you for this

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.

3 participants