Commit aa10e577bc882b2e7ea18c5c34831af176c40374
1 parent
45c5703f
UI: add method to get latest telemetry to Attribute service
Showing
1 changed file
with
9 additions
and
0 deletions
@@ -135,4 +135,13 @@ export class AttributeService { | @@ -135,4 +135,13 @@ export class AttributeService { | ||
135 | 135 | ||
136 | return this.http.get<TimeseriesData>(url, defaultHttpOptionsFromConfig(config)); | 136 | return this.http.get<TimeseriesData>(url, defaultHttpOptionsFromConfig(config)); |
137 | } | 137 | } |
138 | + | ||
139 | + public getEntityTimeseriesLatest(entityId: EntityId, keys?: Array<string>, | ||
140 | + useStrictDataTypes = false, config?: RequestConfig): Observable<TimeseriesData> { | ||
141 | + let url = `/api/plugins/telemetry/${entityId.entityType}/${entityId.id}/values/timeseries?useStrictDataTypes=${useStrictDataTypes}`; | ||
142 | + if (isDefinedAndNotNull(keys) && keys.length) { | ||
143 | + url += `&keys=${keys.join(',')}`; | ||
144 | + } | ||
145 | + return this.http.get<TimeseriesData>(url, defaultHttpOptionsFromConfig(config)); | ||
146 | + } | ||
138 | } | 147 | } |