Skip to content

Conversation

@PTKu
Copy link
Contributor

@PTKu PTKu commented Sep 5, 2025

This pull request introduces improvements to logging for connection attempts and identity management, and refactors how identities are assigned and written in the TwinIdentityProvider class. It also adds error handling for duplicate identities to ensure uniqueness and robustness in identity assignment.

Logging Enhancements

  • Added logging statements to indicate when a connection attempt is made in the WebApiConnector constructor, improving traceability of connection operations. [1] [2]
  • Added logging for identity reading and assignment, providing clearer insight into identity operations.

Identity Management Refactoring

  • Refactored the identity assignment logic in TwinIdentityProvider by extracting it into a new method AssignIdentities, allowing for customizable identity assignment algorithms and improving code clarity.
  • Added a new method WriteIdentities to handle writing identities to the PLC, separating concerns and making the workflow more explicit.
  • Updated ConstructIdentitiesAsync to support custom identity assignment algorithms via an optional parameter, increasing flexibility.

Error Handling

  • Introduced a DuplicateIdentityException that is thrown when duplicate identities are detected during sorting, ensuring that assigned identities are unique and providing a clear error message for debugging.

Minor Code Improvements

  • Added minor whitespace and formatting improvements in WebApiConnector for readability.

closes #447

@PTKu PTKu linked an issue Sep 5, 2025 that may be closed by this pull request
Updated WebApiConnector to include logging for connection attempts and introduced a new HTTP client.
Refactored TwinIdentityProvider to implement flexible identity assignment with new methods for assigning and writing identities.
Added DuplicateIdentityException for improved error handling during identity sorting.
@PTKu PTKu marked this pull request as ready for review September 5, 2025 13:54
@PTKu PTKu merged commit dcf9d98 into dev Sep 5, 2025
2 checks passed
@PTKu PTKu deleted the 447-feat-split-checking-reading-and-assingin-identities branch September 5, 2025 13:55
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.

[feat] Split checking reading and assingin identities

2 participants