Unify charge point command channel status
This commit is contained in:
@@ -35,7 +35,7 @@ function timeAgo(dateStr: string | null | undefined): string {
|
||||
}
|
||||
|
||||
function cpOnline(cp: ChargePoint): boolean {
|
||||
if (!cp.lastHeartbeatAt) return false;
|
||||
if (cp.transportStatus !== "online" || !cp.lastHeartbeatAt) return false;
|
||||
return dayjs().diff(dayjs(cp.lastHeartbeatAt), "second") < 120;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user