Skip to content

Conversation

@alexrudd2
Copy link
Collaborator

See #1599 for background.

The current code has a check if fc_as_hex in self._write_fc:. If this check fails, it means the function was called with a Modbus function code which isn't a write.

This will never happen normally. If there is bad calling code, a confusing NameError is thrown because self.result is undefined.

This PR makes the check explicit (and solves another mypy error). An alternative is to simply delete the check.

Copy link
Collaborator

@janiversen janiversen left a comment

Choose a reason for hiding this comment

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

I like this one!

@janiversen janiversen merged commit 07c43b5 into dev Mar 7, 2024
@janiversen janiversen deleted the remote-datastore-fc branch March 7, 2024 07:25
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants