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

Fix cover not updating correctly #292

Merged
merged 2 commits into from
Nov 21, 2021
Merged

Conversation

night199uk
Copy link
Contributor

When moving a cover we currently set waitingForUpdate = false BEFORE checking if the update is to be ignored.

Since requestPositionUpdate has this:

    if (this.waitingForUpdate) {
      // Manually polling for the state, as we have not yet received an update.
      this.accessory.queueKeyForGetAction(this.positionExpose.property);
    }

This means if we ignore the first update from a cover; we stop requesting the cover for future updates in the timer and cannot update it's status. This tweak moves the waitingForUpdate reset until after the ignored check.

@sonarcloud
Copy link

sonarcloud bot commented Oct 1, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Oct 1, 2021

Codecov Report

Merging #292 (4cc20bd) into master (9a0a2e2) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 4cc20bd differs from pull request most recent head b05f0df. Consider uploading reports for the commit b05f0df to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master     #292   +/-   ##
=======================================
  Coverage   56.57%   56.57%           
=======================================
  Files          22       22           
  Lines        1681     1681           
  Branches      428      428           
=======================================
  Hits          951      951           
  Misses        426      426           
  Partials      304      304           
Flag Coverage Δ
tests 56.57% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/converters/cover.ts 80.46% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a0a2e2...b05f0df. Read the comment docs.

@itavero
Copy link
Owner

itavero commented Nov 21, 2021

Change looks good to me. I've also updated the changelog to reflect this fix.

PS: Sorry that it took me awhile to get to this PR.

@itavero itavero merged commit 5d3a14b into itavero:master Nov 21, 2021
@github-actions
Copy link
Contributor

❌ Failed to run SonarCloud and/or code coverage step.

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.

2 participants