Skip to content

Commit

Permalink
Using right prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
kopiro committed Aug 27, 2024
1 parent d0f825e commit fea2465
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/cameraAccessory.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
API,
Logging,
LogLevel,

Check failure on line 4 in src/cameraAccessory.ts

View workflow job for this annotation

GitHub Actions / build (18.13.0)

'LogLevel' is defined but never used

Check failure on line 4 in src/cameraAccessory.ts

View workflow job for this annotation

GitHub Actions / build (20.16.x)

'LogLevel' is defined but never used

Check failure on line 4 in src/cameraAccessory.ts

View workflow job for this annotation

GitHub Actions / build (22.5.x)

'LogLevel' is defined but never used
PlatformAccessory,
PlatformAccessoryEvent,
Service,
Expand Down Expand Up @@ -62,8 +63,11 @@ export class CameraAccessory {
private readonly platform: CameraPlatform,
private readonly config: CameraConfig
) {
this.log = this.platform.log;
this.log.prefix = this.config.name;
// @ts-expect-error - private property
this.log = {
...this.platform.log,
prefix: this.platform.log.prefix + `/${this.config.name}`,
};

this.api = this.platform.api;
this.accessory = new this.api.platformAccessory(
Expand Down Expand Up @@ -234,6 +238,7 @@ export class CameraAccessory {
}

this.pullIntervalTick = setInterval(() => {
this.log.debug("Polling status...");
this.getStatusAndNotify();
}, this.config.pullInterval || this.platform.kDefaultPullInterval);
}
Expand Down

0 comments on commit fea2465

Please sign in to comment.