Skip to content

Commit

Permalink
fix: add silly logs for entity exclusion
Browse files Browse the repository at this point in the history
related to #40
  • Loading branch information
t0bst4r committed Nov 6, 2024
1 parent 56299c6 commit e635f91
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/backend/src/home-assistant/home-assistant-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,18 @@ export class HomeAssistantClient
if (!this._registry) {
throw new Error("Home Assistant Client is not yet initialized");
}
return _.pickBy(
this._registry,
(r) => isValidEntity(r) && matchEntityFilter(r, filter),
);
return _.pickBy(this._registry, (r) => {
const isValid = isValidEntity(r);
if (!isValid) {
this.log.silly(
"Entity '%s' is excluded. Disabled by: %s, hidden by: %s",
r.entity_id,
r.disabled_by,
r.hidden_by,
);
}
return isValid && matchEntityFilter(r, filter);
});
}

initialStates(entityIds: string[]): Dictionary<HomeAssistantEntityState> {
Expand Down

0 comments on commit e635f91

Please sign in to comment.