Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
Reduce logging around events
Browse files Browse the repository at this point in the history
  • Loading branch information
sponte committed Jun 19, 2021
1 parent 681526c commit c73a6c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@evops/homebridge-hikvision",
"version": "1.0.16",
"version": "1.0.17",
"main": "dist/index.js",
"license": "MIT",
"repository": {
Expand Down
11 changes: 4 additions & 7 deletions src/HikVisionNVR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class HikVisionNVR {
private processHikVisionEvent(event: any) {
switch (event.EventNotificationAlert.eventType) {
case "videoloss":
this.log.info("videoloss, nothing to do...");
this.log.debug("videoloss, nothing to do...");
break;
case "fielddetection":
case "linedetection":
Expand All @@ -122,22 +122,19 @@ export class HikVisionNVR {
(camera) => camera.accessory.context.channelId === channelId
);
if (!camera) {
return this.log.info("Could not find camera for event", event);
return this.log.warn("Could not find camera for event", event);
}

this.log.info(
"Motion detected on camera, triggering motion",
camera.displayName,
motionDetected,
camera.motionDetected
"Motion detected on camera, triggering motion for ",
camera.displayName
);

if (motionDetected !== camera.motionDetected) {
camera.motionDetected = motionDetected;
const motionService = camera.getService(
this.homebridgeApi.hap.Service.MotionSensor
);
this.log.info(motionService, camera, camera.accessory);
motionService?.setCharacteristic(
this.homebridgeApi.hap.Characteristic.MotionDetected,
motionDetected
Expand Down

0 comments on commit c73a6c1

Please sign in to comment.