-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A few small optimizations #369
Conversation
@@ -409,7 +403,7 @@ async def read_attribute( | |||
) | |||
) | |||
read_atributes = self._parse_attributes_from_read_result(result.attributes) | |||
return read_atributes[attribute_path] | |||
return read_atributes.get(attribute_path, None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None
is the default value returned when the key is missing in the dict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
read_attributes
node_lock = self._get_node_lock(node_id) | ||
if self.chip_controller is None: | ||
raise RuntimeError("Device Controller not initialized.") | ||
try: | ||
# the sdk crashes when multiple resolves happen at the same time | ||
# guard simultane resolves with a lock. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simultaneous
Some small speedups and code cleanup