Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 4 additions & 18 deletions src/data/logbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export const getLogbookDataForContext = async (
startDate,
undefined,
undefined,
undefined,
contextId
)
);
Expand All @@ -56,20 +55,13 @@ export const getLogbookData = async (
hass: HomeAssistant,
startDate: string,
endDate: string,
entityId?: string,
entity_matches_only?: boolean
entityId?: string
): Promise<LogbookEntry[]> => {
const localize = await hass.loadBackendTranslation("device_class");
return addLogbookMessage(
hass,
localize,
await getLogbookDataCache(
hass,
startDate,
endDate,
entityId,
entity_matches_only
)
await getLogbookDataCache(hass, startDate, endDate, entityId)
);
};

Expand Down Expand Up @@ -97,8 +89,7 @@ export const getLogbookDataCache = async (
hass: HomeAssistant,
startDate: string,
endDate: string,
entityId?: string,
entity_matches_only?: boolean
entityId?: string
) => {
const ALL_ENTITIES = "*";

Expand All @@ -125,8 +116,7 @@ export const getLogbookDataCache = async (
hass,
startDate,
endDate,
entityId !== ALL_ENTITIES ? entityId : undefined,
entity_matches_only
entityId !== ALL_ENTITIES ? entityId : undefined
).then((entries) => entries.reverse());
return DATA_CACHE[cacheKey][entityId];
};
Expand All @@ -136,7 +126,6 @@ const getLogbookDataFromServer = async (
startDate: string,
endDate?: string,
entityId?: string,
entitymatchesOnly?: boolean,
contextId?: string
) => {
const params = new URLSearchParams();
Expand All @@ -147,9 +136,6 @@ const getLogbookDataFromServer = async (
if (entityId) {
params.append("entity", entityId);
}
if (entitymatchesOnly) {
params.append("entity_matches_only", "");
}
if (contextId) {
params.append("context_id", contextId);
}
Expand Down