cmroche / greeclimate

Python package for controlling Gree based minisplit systems
GNU General Public License v3.0
44 stars 22 forks source link

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

Open mlesniew opened 1 month ago

mlesniew commented 1 month ago

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.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.