Skip to content
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

Make Device.update_state and Device.push_state_update wait for a reply from the AC #108

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mlesniew
Copy link

The Device.update_state and Device.push_state_update methods previously sent requests to the remote device without awaiting a response, leaving the caller unable to verify whether the operation was successfully received and confirmed.

This PR modifies that behavior. Both methods now wait for a response from the device before returning.

Additionally, although both methods already accepted a wait_for parameter, but it was ignored. This parameter is now used as the timeout for receiving the response. If no response is received within the specified time, an exception is raised.

This change makes the `Device.update_state` wait for the properties
to actually be updated before returning.  The wait time is limited
by the `wait_for` parameter (which was previously present, but not
used).

This way, when `Device.update_state` returns, properties are
guaranteed to be updated.

This commit also fixes a few tests, which appear to have had some
bugs.
…se from the AC

This change makes the `Device.push_state_update` wait for the a
response from the AC to be received before returning.  The wait time
is limited by the `wait_for` parameter (which was previously present,
but not used).

This way callers of `Device.push_state_update` can be sure that
their request reached the AC when the method returns.
Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.08%. Comparing base (7122cdd) to head (5dbd56e).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #108      +/-   ##
==========================================
+ Coverage   95.75%   96.08%   +0.32%     
==========================================
  Files           8        8              
  Lines         730      740      +10     
==========================================
+ Hits          699      711      +12     
+ Misses         31       29       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant