HAP-NodeJS icon indicating copy to clipboard operation
HAP-NodeJS copied to clipboard

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

Open bauer-andreas opened this issue 3 years ago • 1 comments

:recycle: 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.

:bulb: 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.

:gear: 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.

:heavy_plus_sign: Additional Information

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

Testing

--

Reviewer Nudging

CC @hjdhjd

bauer-andreas avatar Apr 23 '22 17:04 bauer-andreas

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%
<!-- Total: 2 11
Files with Coverage Reduction New Missed Lines %
src/lib/camera/RecordingManagement.ts 1 50.84%
<!-- Total: 1
Totals Coverage Status
Change from base Build 3072827572: -0.03%
Covered Lines: 5720
Relevant Lines: 10098

💛 - Coveralls

coveralls avatar Apr 23 '22 17:04 coveralls