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

HKSV: Skip updateRecordingActive delegate call if value didn't change #944

Merged
merged 4 commits into from
Sep 17, 2022

Conversation

Supereg
Copy link
Member

@Supereg Supereg commented Apr 23, 2022

♻️ Current situation

As of now, every write to the Active characteristic of the CameraRecordingManagement service is plainly forwarded to the CameraRecordingDelegate. HomeHub write to this characteristic a lot, even though state isn't changed.

💡 Proposed solution

This PR proposes to include a check to determine if the active value changed before calling the delegate. This will remove the burden on developers to do this check themselves.

⚙️ Release Notes

  • CameraRecordingDelegate.updateRecordingActive() is now only ever called if the value actually changed. This is considered a breaking change. It is continued to be called on every startup if recording is enabled, and it will continue to be called on a factory reset (e.g. when all pairings are removed) independent of the current state.

➕ Additional Information

This PR includes a breaking change and is planned for the next major/minor release.

Testing

--

Reviewer Nudging

CC @hjdhjd

@github-actions github-actions bot added the fix label Apr 23, 2022
@coveralls
Copy link

coveralls commented Apr 23, 2022

Pull Request Test Coverage Report for Build 3072828789

  • 2 of 11 (18.18%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 51.718%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/lib/camera/RecordingManagement.ts 2 11 18.18%
Files with Coverage Reduction New Missed Lines %
src/lib/camera/RecordingManagement.ts 1 50.84%
Totals Coverage Status
Change from base Build 3072827572: -0.03%
Covered Lines: 5720
Relevant Lines: 10098

💛 - Coveralls

@homebridge homebridge deleted a comment from TecnologiaMundia Jun 10, 2022
@Supereg Supereg changed the base branch from master to beta-0.11.0 September 17, 2022 06:31
@Supereg Supereg marked this pull request as ready for review September 17, 2022 09:14
@Supereg Supereg merged commit e0e1483 into beta-0.11.0 Sep 17, 2022
@Supereg Supereg deleted the fix/update-recording-active-call branch September 17, 2022 09:28
@Supereg Supereg added enhancement and removed fix labels Sep 17, 2022
Supereg added a commit that referenced this pull request Nov 18, 2022
…#944)

* HKSV: Skip updateRecordingActive delegate call if value didn't change

* Only call a RecordingDelegates `updateRecordingConfiguration` if the updated configuration changed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants