@enyo-energy/energy-app-sdk 0.0.145 → 0.0.146

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -62,23 +62,24 @@ export interface EebusCevcClient extends EebusUseCaseClient {
62
62
  publishIncentiveTable: (table: EebusOhpcfIncentiveTable) => Promise<void>;
63
63
  /**
64
64
  * Return the most recent time-series charging plan the SDK has
65
- * observed on this peer, without dispatching a wire read.
66
- * Synchronous and side-effect-free.
65
+ * observed on this peer, without dispatching a wire read. Resolves
66
+ * from the lib's cached snapshot — side-effect-free.
67
67
  *
68
- * Returns `undefined` until the first plan notify has landed, and
69
- * will keep returning `undefined` on peers that do not implement
70
- * `TimeSeries` until that client lands in `@enyo-energy/eebus`.
68
+ * Resolves to `undefined` until the first plan notify has landed,
69
+ * and will keep resolving to `undefined` on peers that do not
70
+ * implement `TimeSeries` until that client lands in
71
+ * `@enyo-energy/eebus`.
71
72
  */
72
- getLastTimeSeriesPlan: () => EebusCevcChargingPlan | undefined;
73
+ getLastTimeSeriesPlan: () => Promise<EebusCevcChargingPlan | undefined>;
73
74
  /**
74
75
  * Return the most recent incentive table the SDK has observed on
75
- * this peer, without dispatching a wire read. Synchronous and
76
- * side-effect-free.
76
+ * this peer, without dispatching a wire read. Resolves from the
77
+ * lib's cached snapshot — side-effect-free.
77
78
  *
78
- * Returns `undefined` until the first `incentiveTableData` notify
79
- * has landed.
79
+ * Resolves to `undefined` until the first `incentiveTableData`
80
+ * notify has landed.
80
81
  */
81
- getLastIncentiveTable: () => EebusOhpcfIncentiveTable | undefined;
82
+ getLastIncentiveTable: () => Promise<EebusOhpcfIncentiveTable | undefined>;
82
83
  /**
83
84
  * Subscribe to plan-state updates published by the EV (e.g. revised
84
85
  * plan after the EV revised its capacity estimate).
@@ -51,12 +51,13 @@ export interface EebusEvccClient extends EebusUseCaseClient {
51
51
  /**
52
52
  * Return the most recent EV identification (EVCCID + identification
53
53
  * type) the SDK has observed on this peer, without dispatching a
54
- * wire read. Synchronous and side-effect-free.
54
+ * wire read. Resolves from the lib's cached snapshot —
55
+ * side-effect-free.
55
56
  *
56
- * Returns `undefined` until the first `identificationListData`
57
+ * Resolves to `undefined` until the first `identificationListData`
57
58
  * notify has landed.
58
59
  */
59
- getLastEvIdentification: () => EebusEvIdentification | undefined;
60
+ getLastEvIdentification: () => Promise<EebusEvIdentification | undefined>;
60
61
  /**
61
62
  * Return the most recent `DeviceConfiguration.keyValueListData`
62
63
  * snapshot the SDK has observed on this peer. Surfaces every
@@ -66,40 +67,41 @@ export interface EebusEvccClient extends EebusUseCaseClient {
66
67
  * {@link supportsAsymmetricCharging} which already narrow the
67
68
  * lookup.
68
69
  *
69
- * Returns `undefined` until the first notify has landed.
70
+ * Resolves to `undefined` until the first notify has landed.
70
71
  */
71
- getLastEvConfiguration: () => EebusEvConfigurationSnapshot | undefined;
72
+ getLastEvConfiguration: () => Promise<EebusEvConfigurationSnapshot | undefined>;
72
73
  /**
73
74
  * Return the most recent EV electrical permitted-value snapshot the
74
75
  * SDK has observed on this peer — per-phase minimum / maximum
75
76
  * current and total power the EV reports as allowable.
76
77
  *
77
- * Returns `undefined` until the first
78
+ * Resolves to `undefined` until the first
78
79
  * `permittedValueSetListData` notify has landed.
79
80
  */
80
- getLastEvElectricalLimits: () => EebusEvElectricalLimits | undefined;
81
+ getLastEvElectricalLimits: () => Promise<EebusEvElectricalLimits | undefined>;
81
82
  /**
82
83
  * Read the EV's negotiated communication standard from the cached
83
84
  * configuration snapshot — `'IEC61851'`, `'ISO15118-2'`,
84
- * `'ISO15118-20'`, etc. Synchronous; does not hit the wire.
85
+ * `'ISO15118-20'`, etc. Resolves from the lib's cached snapshot;
86
+ * does not hit the wire.
85
87
  *
86
- * Distinct from {@link getEvCommunicationStandard} (async, returns
87
- * the typed enum) — this getter returns the raw wire string for
88
+ * Distinct from {@link getEvCommunicationStandard} which returns
89
+ * the typed enum — this getter returns the raw wire string for
88
90
  * vendor-specific values the enum doesn't cover, and `undefined`
89
91
  * when the key is not yet cached.
90
92
  */
91
- getCommunicationStandard: () => string | undefined;
93
+ getCommunicationStandard: () => Promise<string | undefined>;
92
94
  /**
93
95
  * Read whether the EV advertises asymmetric (per-phase) charging
94
- * support from the cached configuration snapshot. Synchronous;
95
- * does not hit the wire.
96
+ * support from the cached configuration snapshot. Resolves from the
97
+ * lib's cached snapshot; does not hit the wire.
96
98
  *
97
- * Returns `undefined` when the key is not yet cached (handshake
99
+ * Resolves to `undefined` when the key is not yet cached (handshake
98
100
  * still in progress, or the EV does not publish the key at all).
99
101
  * Callers that need a boolean-only answer should treat `undefined`
100
102
  * as `false` only after {@link ready} reports the client is bound.
101
103
  */
102
- supportsAsymmetricCharging: () => boolean | undefined;
104
+ supportsAsymmetricCharging: () => Promise<boolean | undefined>;
103
105
  /**
104
106
  * Subscribe to EV-connect events (vehicle plugged in).
105
107
  */
@@ -32,12 +32,12 @@ export interface EebusEvcemClient extends EebusUseCaseClient {
32
32
  getCurrentMeasurement: () => Promise<EebusEvcemReading>;
33
33
  /**
34
34
  * Return the most recent telemetry sample the SDK has observed on
35
- * this peer, without dispatching a wire read. Synchronous and
36
- * side-effect-free.
35
+ * this peer, without dispatching a wire read. Resolves from the
36
+ * lib's cached snapshot — side-effect-free.
37
37
  *
38
- * Returns `undefined` until the first inbound notify has landed.
38
+ * Resolves to `undefined` until the first inbound notify has landed.
39
39
  */
40
- getLastMeasurement: () => EebusEvcemReading | undefined;
40
+ getLastMeasurement: () => Promise<EebusEvcemReading | undefined>;
41
41
  /**
42
42
  * Subscribe to per-update telemetry samples.
43
43
  *
@@ -31,14 +31,14 @@ export interface EebusEvsocClient extends EebusUseCaseClient {
31
31
  getStateOfChargePercent: () => Promise<number>;
32
32
  /**
33
33
  * Return the most recent SoC sample the SDK has observed on this
34
- * peer, without dispatching a wire read. Synchronous and
35
- * side-effect-free.
34
+ * peer, without dispatching a wire read. Resolves from the lib's
35
+ * cached snapshot — side-effect-free.
36
36
  *
37
- * Returns `undefined` until the first SoC notify has landed — and
38
- * may stay `undefined` indefinitely on vehicles that do not publish
39
- * their SoC over EEBUS (see the class-level note).
37
+ * Resolves to `undefined` until the first SoC notify has landed —
38
+ * and may stay `undefined` indefinitely on vehicles that do not
39
+ * publish their SoC over EEBUS (see the class-level note).
40
40
  */
41
- getLastStateOfCharge: () => EebusEvSocReading | undefined;
41
+ getLastStateOfCharge: () => Promise<EebusEvSocReading | undefined>;
42
42
  /**
43
43
  * Subscribe to SoC updates.
44
44
  *
@@ -215,10 +215,10 @@ export interface EebusLpcClient extends EebusUseCaseClient {
215
215
  /**
216
216
  * Resolve the descriptor for a LoadControl limit slot on the peer,
217
217
  * using the SDK's cached `loadControlLimitDescriptionListData`.
218
- * Synchronous; does not hit the wire.
218
+ * Resolves from the cached snapshot; does not hit the wire.
219
219
  *
220
- * Returns the matching descriptor, or `undefined` when no slot on
221
- * the resolved entity satisfies the requested
220
+ * Resolves to the matching descriptor, or `undefined` when no slot
221
+ * on the resolved entity satisfies the requested
222
222
  * {@link FindLpcLimitOptions.direction} (and, when supplied,
223
223
  * {@link FindLpcLimitOptions.category}). On peers that advertise
224
224
  * several matching slots the resolver returns the first one in
@@ -226,7 +226,7 @@ export interface EebusLpcClient extends EebusUseCaseClient {
226
226
  * should use {@link EebusFeatureCatalog.findFeatureAddressForClient}
227
227
  * + a per-slot enumeration.
228
228
  */
229
- findLimit: (opts: FindLpcLimitOptions) => EebusLpcLimitDescriptor | undefined;
229
+ findLimit: (opts: FindLpcLimitOptions) => Promise<EebusLpcLimitDescriptor | undefined>;
230
230
  /**
231
231
  * Resolve the per-phase `limitId`s advertised by the peer for a
232
232
  * given limit {@link FindPerPhaseLimitIdsOptions.category}, in
@@ -234,9 +234,9 @@ export interface EebusLpcClient extends EebusUseCaseClient {
234
234
  * current limits over LoadControl (the OPEV / OSCEV path on
235
235
  * wallboxes that don't expose a dedicated OPEV feature).
236
236
  *
237
- * Returns `undefined` when the peer does not advertise per-phase
238
- * slots for the requested category. Synchronous; does not hit the
239
- * wire.
237
+ * Resolves to `undefined` when the peer does not advertise
238
+ * per-phase slots for the requested category. Resolves from the
239
+ * cached snapshot; does not hit the wire.
240
240
  */
241
- findPerPhaseLimitIds: (opts: FindPerPhaseLimitIdsOptions) => number[] | undefined;
241
+ findPerPhaseLimitIds: (opts: FindPerPhaseLimitIdsOptions) => Promise<number[] | undefined>;
242
242
  }
@@ -18,14 +18,15 @@ export interface EebusMgcpClient extends EebusUseCaseClient {
18
18
  getReading: () => Promise<EebusMgcpReading>;
19
19
  /**
20
20
  * Return the most recent reading the SDK has observed on this peer
21
- * without dispatching a wire read. Synchronous and side-effect-free.
21
+ * without dispatching a wire read. Resolves from the lib's cached
22
+ * snapshot — side-effect-free.
22
23
  *
23
- * Returns `undefined` until the first inbound notify lands.
24
+ * Resolves to `undefined` until the first inbound notify lands.
24
25
  * Subsequent notifies update the snapshot — callers that only need
25
26
  * to poll the latest value can drop their {@link onReading}
26
27
  * subscription in favour of this getter.
27
28
  */
28
- getLastReading: () => EebusMgcpReading | undefined;
29
+ getLastReading: () => Promise<EebusMgcpReading | undefined>;
29
30
  /**
30
31
  * Subscribe to updates whenever the grid connection point publishes new telemetry.
31
32
  * @param listener Callback invoked with each new reading
@@ -87,16 +87,17 @@ export interface EebusMpcClient extends EebusUseCaseClient {
87
87
  getReading: () => Promise<EebusMpcReading>;
88
88
  /**
89
89
  * Return the most recent reading the SDK has observed on this peer
90
- * without dispatching a wire read. Synchronous and side-effect-free.
90
+ * without dispatching a wire read. Resolves from the lib's cached
91
+ * snapshot — side-effect-free.
91
92
  *
92
- * Returns `undefined` until the first `measurementListData` notify
93
- * lands after attach (the SPINE binding is in progress, or the peer
94
- * has not pushed any sample yet). Once populated, the snapshot
95
- * tracks every subsequent notify — callers do not need to combine
96
- * this with a manual {@link onReading} subscription unless they
97
- * want push-style delivery.
93
+ * Resolves to `undefined` until the first `measurementListData`
94
+ * notify lands after attach (the SPINE binding is in progress, or
95
+ * the peer has not pushed any sample yet). Once populated, the
96
+ * snapshot tracks every subsequent notify — callers do not need to
97
+ * combine this with a manual {@link onReading} subscription unless
98
+ * they want push-style delivery.
98
99
  */
99
- getLastReading: () => EebusMpcReading | undefined;
100
+ getLastReading: () => Promise<EebusMpcReading | undefined>;
100
101
  /**
101
102
  * Subscribe to updates whenever the controllable system publishes new telemetry.
102
103
  * @param listener Callback invoked with each new reading
@@ -116,15 +117,15 @@ export interface EebusMpcClient extends EebusUseCaseClient {
116
117
  removeListener: (listenerId: string) => void;
117
118
  /**
118
119
  * Resolve the descriptor for a Measurement slot on the peer, using
119
- * the SDK's cached `measurementDescriptionListData`. Synchronous;
120
- * does not hit the wire.
120
+ * the SDK's cached `measurementDescriptionListData`. Resolves from
121
+ * the cached snapshot; does not hit the wire.
121
122
  *
122
- * Returns the matching descriptor, or `undefined` when no slot on
123
- * the resolved entity satisfies the requested
123
+ * Resolves to the matching descriptor, or `undefined` when no slot
124
+ * on the resolved entity satisfies the requested
124
125
  * {@link FindMpcMeasurementOptions.scope} (and, when supplied,
125
126
  * {@link FindMpcMeasurementOptions.commodity}). On peers that
126
127
  * advertise several matching slots the resolver returns the first
127
128
  * one in description-list order.
128
129
  */
129
- findMeasurement: (opts: FindMpcMeasurementOptions) => EebusMpcMeasurementDescriptor | undefined;
130
+ findMeasurement: (opts: FindMpcMeasurementOptions) => Promise<EebusMpcMeasurementDescriptor | undefined>;
130
131
  }
@@ -38,22 +38,26 @@ export interface EebusUseCaseReadiness {
38
38
  * readiness state so a consumer can answer "is this peer ready for me to
39
39
  * use this use case yet?" without firing any wire traffic.
40
40
  *
41
- * The probe is synchronous and side-effect-free: it neither triggers nor
42
- * waits for the handshake. Call it from a render path, an event handler,
43
- * or a polling loop without worrying about cost.
41
+ * The probe is side-effect-free: it neither triggers nor waits for the
42
+ * handshake the returned promise resolves from the lib's cached state.
43
+ * The async signature is preserved for symmetry with the rest of the
44
+ * SDK surface (every other use-case method returns a promise) and to
45
+ * keep IPC bridges in consumer packages from having to special-case
46
+ * this one method.
44
47
  */
45
48
  export interface EebusUseCaseClient {
46
49
  /**
47
50
  * Probe the lib's cached readiness state for this use-case client.
48
51
  *
49
- * Returns `{ ready: true }` once the peer is fully bound and
50
- * subscribed. Returns `{ ready: false, reason }` while any
52
+ * Resolves to `{ ready: true }` once the peer is fully bound and
53
+ * subscribed. Resolves to `{ ready: false, reason }` while any
51
54
  * precondition is outstanding — {@link EebusUseCaseReadiness.reason}
52
55
  * carries the lib-published explanation so callers can distinguish
53
56
  * "peer is offline" from "peer does not support this use case" from
54
57
  * "binding is still in flight".
55
58
  *
56
- * Synchronous and side-effect-free. Safe to call from hot paths.
59
+ * Side-effect-free and cached — resolves immediately. Safe to call
60
+ * from hot paths.
57
61
  */
58
- ready: () => EebusUseCaseReadiness;
62
+ ready: () => Promise<EebusUseCaseReadiness>;
59
63
  }
@@ -44,15 +44,15 @@ export interface EebusVabdClient extends EebusUseCaseClient {
44
44
  getBatteryNominalCapacityWh: () => Promise<number | undefined>;
45
45
  /**
46
46
  * Return the most recent consolidated battery telemetry the SDK has
47
- * observed on this peer, without dispatching a wire read.
48
- * Synchronous and side-effect-free.
47
+ * observed on this peer, without dispatching a wire read. Resolves
48
+ * from the lib's cached snapshot — side-effect-free.
49
49
  *
50
- * Returns `undefined` until the first `measurementListData` notify
51
- * has landed. Once populated, the snapshot tracks every subsequent
52
- * notify — callers can drop their {@link onTelemetry} subscription
53
- * if they only need to poll the latest value.
50
+ * Resolves to `undefined` until the first `measurementListData`
51
+ * notify has landed. Once populated, the snapshot tracks every
52
+ * subsequent notify — callers can drop their {@link onTelemetry}
53
+ * subscription if they only need to poll the latest value.
54
54
  */
55
- getLastTelemetry: () => EebusVabdTelemetry | undefined;
55
+ getLastTelemetry: () => Promise<EebusVabdTelemetry | undefined>;
56
56
  /**
57
57
  * Subscribe to consolidated battery telemetry updates.
58
58
  */
@@ -38,12 +38,12 @@ export interface EebusVapdClient extends EebusUseCaseClient {
38
38
  getPvNominalPeakPowerW: () => Promise<number | undefined>;
39
39
  /**
40
40
  * Return the most recent consolidated PV telemetry the SDK has
41
- * observed on this peer, without dispatching a wire read.
42
- * Synchronous and side-effect-free.
41
+ * observed on this peer, without dispatching a wire read. Resolves
42
+ * from the lib's cached snapshot — side-effect-free.
43
43
  *
44
- * Returns `undefined` until the first inbound notify has landed.
44
+ * Resolves to `undefined` until the first inbound notify has landed.
45
45
  */
46
- getLastTelemetry: () => EebusVapdTelemetry | undefined;
46
+ getLastTelemetry: () => Promise<EebusVapdTelemetry | undefined>;
47
47
  /**
48
48
  * Subscribe to consolidated PV telemetry updates.
49
49
  */
@@ -9,7 +9,7 @@ exports.getSdkVersion = getSdkVersion;
9
9
  /**
10
10
  * Current version of the enyo Energy App SDK.
11
11
  */
12
- exports.SDK_VERSION = '0.0.145';
12
+ exports.SDK_VERSION = '0.0.146';
13
13
  /**
14
14
  * Gets the current SDK version.
15
15
  * @returns The semantic version string of the SDK
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export declare const SDK_VERSION = "0.0.145";
8
+ export declare const SDK_VERSION = "0.0.146";
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
@@ -62,23 +62,24 @@ export interface EebusCevcClient extends EebusUseCaseClient {
62
62
  publishIncentiveTable: (table: EebusOhpcfIncentiveTable) => Promise<void>;
63
63
  /**
64
64
  * Return the most recent time-series charging plan the SDK has
65
- * observed on this peer, without dispatching a wire read.
66
- * Synchronous and side-effect-free.
65
+ * observed on this peer, without dispatching a wire read. Resolves
66
+ * from the lib's cached snapshot — side-effect-free.
67
67
  *
68
- * Returns `undefined` until the first plan notify has landed, and
69
- * will keep returning `undefined` on peers that do not implement
70
- * `TimeSeries` until that client lands in `@enyo-energy/eebus`.
68
+ * Resolves to `undefined` until the first plan notify has landed,
69
+ * and will keep resolving to `undefined` on peers that do not
70
+ * implement `TimeSeries` until that client lands in
71
+ * `@enyo-energy/eebus`.
71
72
  */
72
- getLastTimeSeriesPlan: () => EebusCevcChargingPlan | undefined;
73
+ getLastTimeSeriesPlan: () => Promise<EebusCevcChargingPlan | undefined>;
73
74
  /**
74
75
  * Return the most recent incentive table the SDK has observed on
75
- * this peer, without dispatching a wire read. Synchronous and
76
- * side-effect-free.
76
+ * this peer, without dispatching a wire read. Resolves from the
77
+ * lib's cached snapshot — side-effect-free.
77
78
  *
78
- * Returns `undefined` until the first `incentiveTableData` notify
79
- * has landed.
79
+ * Resolves to `undefined` until the first `incentiveTableData`
80
+ * notify has landed.
80
81
  */
81
- getLastIncentiveTable: () => EebusOhpcfIncentiveTable | undefined;
82
+ getLastIncentiveTable: () => Promise<EebusOhpcfIncentiveTable | undefined>;
82
83
  /**
83
84
  * Subscribe to plan-state updates published by the EV (e.g. revised
84
85
  * plan after the EV revised its capacity estimate).
@@ -51,12 +51,13 @@ export interface EebusEvccClient extends EebusUseCaseClient {
51
51
  /**
52
52
  * Return the most recent EV identification (EVCCID + identification
53
53
  * type) the SDK has observed on this peer, without dispatching a
54
- * wire read. Synchronous and side-effect-free.
54
+ * wire read. Resolves from the lib's cached snapshot —
55
+ * side-effect-free.
55
56
  *
56
- * Returns `undefined` until the first `identificationListData`
57
+ * Resolves to `undefined` until the first `identificationListData`
57
58
  * notify has landed.
58
59
  */
59
- getLastEvIdentification: () => EebusEvIdentification | undefined;
60
+ getLastEvIdentification: () => Promise<EebusEvIdentification | undefined>;
60
61
  /**
61
62
  * Return the most recent `DeviceConfiguration.keyValueListData`
62
63
  * snapshot the SDK has observed on this peer. Surfaces every
@@ -66,40 +67,41 @@ export interface EebusEvccClient extends EebusUseCaseClient {
66
67
  * {@link supportsAsymmetricCharging} which already narrow the
67
68
  * lookup.
68
69
  *
69
- * Returns `undefined` until the first notify has landed.
70
+ * Resolves to `undefined` until the first notify has landed.
70
71
  */
71
- getLastEvConfiguration: () => EebusEvConfigurationSnapshot | undefined;
72
+ getLastEvConfiguration: () => Promise<EebusEvConfigurationSnapshot | undefined>;
72
73
  /**
73
74
  * Return the most recent EV electrical permitted-value snapshot the
74
75
  * SDK has observed on this peer — per-phase minimum / maximum
75
76
  * current and total power the EV reports as allowable.
76
77
  *
77
- * Returns `undefined` until the first
78
+ * Resolves to `undefined` until the first
78
79
  * `permittedValueSetListData` notify has landed.
79
80
  */
80
- getLastEvElectricalLimits: () => EebusEvElectricalLimits | undefined;
81
+ getLastEvElectricalLimits: () => Promise<EebusEvElectricalLimits | undefined>;
81
82
  /**
82
83
  * Read the EV's negotiated communication standard from the cached
83
84
  * configuration snapshot — `'IEC61851'`, `'ISO15118-2'`,
84
- * `'ISO15118-20'`, etc. Synchronous; does not hit the wire.
85
+ * `'ISO15118-20'`, etc. Resolves from the lib's cached snapshot;
86
+ * does not hit the wire.
85
87
  *
86
- * Distinct from {@link getEvCommunicationStandard} (async, returns
87
- * the typed enum) — this getter returns the raw wire string for
88
+ * Distinct from {@link getEvCommunicationStandard} which returns
89
+ * the typed enum — this getter returns the raw wire string for
88
90
  * vendor-specific values the enum doesn't cover, and `undefined`
89
91
  * when the key is not yet cached.
90
92
  */
91
- getCommunicationStandard: () => string | undefined;
93
+ getCommunicationStandard: () => Promise<string | undefined>;
92
94
  /**
93
95
  * Read whether the EV advertises asymmetric (per-phase) charging
94
- * support from the cached configuration snapshot. Synchronous;
95
- * does not hit the wire.
96
+ * support from the cached configuration snapshot. Resolves from the
97
+ * lib's cached snapshot; does not hit the wire.
96
98
  *
97
- * Returns `undefined` when the key is not yet cached (handshake
99
+ * Resolves to `undefined` when the key is not yet cached (handshake
98
100
  * still in progress, or the EV does not publish the key at all).
99
101
  * Callers that need a boolean-only answer should treat `undefined`
100
102
  * as `false` only after {@link ready} reports the client is bound.
101
103
  */
102
- supportsAsymmetricCharging: () => boolean | undefined;
104
+ supportsAsymmetricCharging: () => Promise<boolean | undefined>;
103
105
  /**
104
106
  * Subscribe to EV-connect events (vehicle plugged in).
105
107
  */
@@ -32,12 +32,12 @@ export interface EebusEvcemClient extends EebusUseCaseClient {
32
32
  getCurrentMeasurement: () => Promise<EebusEvcemReading>;
33
33
  /**
34
34
  * Return the most recent telemetry sample the SDK has observed on
35
- * this peer, without dispatching a wire read. Synchronous and
36
- * side-effect-free.
35
+ * this peer, without dispatching a wire read. Resolves from the
36
+ * lib's cached snapshot — side-effect-free.
37
37
  *
38
- * Returns `undefined` until the first inbound notify has landed.
38
+ * Resolves to `undefined` until the first inbound notify has landed.
39
39
  */
40
- getLastMeasurement: () => EebusEvcemReading | undefined;
40
+ getLastMeasurement: () => Promise<EebusEvcemReading | undefined>;
41
41
  /**
42
42
  * Subscribe to per-update telemetry samples.
43
43
  *
@@ -31,14 +31,14 @@ export interface EebusEvsocClient extends EebusUseCaseClient {
31
31
  getStateOfChargePercent: () => Promise<number>;
32
32
  /**
33
33
  * Return the most recent SoC sample the SDK has observed on this
34
- * peer, without dispatching a wire read. Synchronous and
35
- * side-effect-free.
34
+ * peer, without dispatching a wire read. Resolves from the lib's
35
+ * cached snapshot — side-effect-free.
36
36
  *
37
- * Returns `undefined` until the first SoC notify has landed — and
38
- * may stay `undefined` indefinitely on vehicles that do not publish
39
- * their SoC over EEBUS (see the class-level note).
37
+ * Resolves to `undefined` until the first SoC notify has landed —
38
+ * and may stay `undefined` indefinitely on vehicles that do not
39
+ * publish their SoC over EEBUS (see the class-level note).
40
40
  */
41
- getLastStateOfCharge: () => EebusEvSocReading | undefined;
41
+ getLastStateOfCharge: () => Promise<EebusEvSocReading | undefined>;
42
42
  /**
43
43
  * Subscribe to SoC updates.
44
44
  *
@@ -215,10 +215,10 @@ export interface EebusLpcClient extends EebusUseCaseClient {
215
215
  /**
216
216
  * Resolve the descriptor for a LoadControl limit slot on the peer,
217
217
  * using the SDK's cached `loadControlLimitDescriptionListData`.
218
- * Synchronous; does not hit the wire.
218
+ * Resolves from the cached snapshot; does not hit the wire.
219
219
  *
220
- * Returns the matching descriptor, or `undefined` when no slot on
221
- * the resolved entity satisfies the requested
220
+ * Resolves to the matching descriptor, or `undefined` when no slot
221
+ * on the resolved entity satisfies the requested
222
222
  * {@link FindLpcLimitOptions.direction} (and, when supplied,
223
223
  * {@link FindLpcLimitOptions.category}). On peers that advertise
224
224
  * several matching slots the resolver returns the first one in
@@ -226,7 +226,7 @@ export interface EebusLpcClient extends EebusUseCaseClient {
226
226
  * should use {@link EebusFeatureCatalog.findFeatureAddressForClient}
227
227
  * + a per-slot enumeration.
228
228
  */
229
- findLimit: (opts: FindLpcLimitOptions) => EebusLpcLimitDescriptor | undefined;
229
+ findLimit: (opts: FindLpcLimitOptions) => Promise<EebusLpcLimitDescriptor | undefined>;
230
230
  /**
231
231
  * Resolve the per-phase `limitId`s advertised by the peer for a
232
232
  * given limit {@link FindPerPhaseLimitIdsOptions.category}, in
@@ -234,9 +234,9 @@ export interface EebusLpcClient extends EebusUseCaseClient {
234
234
  * current limits over LoadControl (the OPEV / OSCEV path on
235
235
  * wallboxes that don't expose a dedicated OPEV feature).
236
236
  *
237
- * Returns `undefined` when the peer does not advertise per-phase
238
- * slots for the requested category. Synchronous; does not hit the
239
- * wire.
237
+ * Resolves to `undefined` when the peer does not advertise
238
+ * per-phase slots for the requested category. Resolves from the
239
+ * cached snapshot; does not hit the wire.
240
240
  */
241
- findPerPhaseLimitIds: (opts: FindPerPhaseLimitIdsOptions) => number[] | undefined;
241
+ findPerPhaseLimitIds: (opts: FindPerPhaseLimitIdsOptions) => Promise<number[] | undefined>;
242
242
  }
@@ -18,14 +18,15 @@ export interface EebusMgcpClient extends EebusUseCaseClient {
18
18
  getReading: () => Promise<EebusMgcpReading>;
19
19
  /**
20
20
  * Return the most recent reading the SDK has observed on this peer
21
- * without dispatching a wire read. Synchronous and side-effect-free.
21
+ * without dispatching a wire read. Resolves from the lib's cached
22
+ * snapshot — side-effect-free.
22
23
  *
23
- * Returns `undefined` until the first inbound notify lands.
24
+ * Resolves to `undefined` until the first inbound notify lands.
24
25
  * Subsequent notifies update the snapshot — callers that only need
25
26
  * to poll the latest value can drop their {@link onReading}
26
27
  * subscription in favour of this getter.
27
28
  */
28
- getLastReading: () => EebusMgcpReading | undefined;
29
+ getLastReading: () => Promise<EebusMgcpReading | undefined>;
29
30
  /**
30
31
  * Subscribe to updates whenever the grid connection point publishes new telemetry.
31
32
  * @param listener Callback invoked with each new reading
@@ -87,16 +87,17 @@ export interface EebusMpcClient extends EebusUseCaseClient {
87
87
  getReading: () => Promise<EebusMpcReading>;
88
88
  /**
89
89
  * Return the most recent reading the SDK has observed on this peer
90
- * without dispatching a wire read. Synchronous and side-effect-free.
90
+ * without dispatching a wire read. Resolves from the lib's cached
91
+ * snapshot — side-effect-free.
91
92
  *
92
- * Returns `undefined` until the first `measurementListData` notify
93
- * lands after attach (the SPINE binding is in progress, or the peer
94
- * has not pushed any sample yet). Once populated, the snapshot
95
- * tracks every subsequent notify — callers do not need to combine
96
- * this with a manual {@link onReading} subscription unless they
97
- * want push-style delivery.
93
+ * Resolves to `undefined` until the first `measurementListData`
94
+ * notify lands after attach (the SPINE binding is in progress, or
95
+ * the peer has not pushed any sample yet). Once populated, the
96
+ * snapshot tracks every subsequent notify — callers do not need to
97
+ * combine this with a manual {@link onReading} subscription unless
98
+ * they want push-style delivery.
98
99
  */
99
- getLastReading: () => EebusMpcReading | undefined;
100
+ getLastReading: () => Promise<EebusMpcReading | undefined>;
100
101
  /**
101
102
  * Subscribe to updates whenever the controllable system publishes new telemetry.
102
103
  * @param listener Callback invoked with each new reading
@@ -116,15 +117,15 @@ export interface EebusMpcClient extends EebusUseCaseClient {
116
117
  removeListener: (listenerId: string) => void;
117
118
  /**
118
119
  * Resolve the descriptor for a Measurement slot on the peer, using
119
- * the SDK's cached `measurementDescriptionListData`. Synchronous;
120
- * does not hit the wire.
120
+ * the SDK's cached `measurementDescriptionListData`. Resolves from
121
+ * the cached snapshot; does not hit the wire.
121
122
  *
122
- * Returns the matching descriptor, or `undefined` when no slot on
123
- * the resolved entity satisfies the requested
123
+ * Resolves to the matching descriptor, or `undefined` when no slot
124
+ * on the resolved entity satisfies the requested
124
125
  * {@link FindMpcMeasurementOptions.scope} (and, when supplied,
125
126
  * {@link FindMpcMeasurementOptions.commodity}). On peers that
126
127
  * advertise several matching slots the resolver returns the first
127
128
  * one in description-list order.
128
129
  */
129
- findMeasurement: (opts: FindMpcMeasurementOptions) => EebusMpcMeasurementDescriptor | undefined;
130
+ findMeasurement: (opts: FindMpcMeasurementOptions) => Promise<EebusMpcMeasurementDescriptor | undefined>;
130
131
  }
@@ -38,22 +38,26 @@ export interface EebusUseCaseReadiness {
38
38
  * readiness state so a consumer can answer "is this peer ready for me to
39
39
  * use this use case yet?" without firing any wire traffic.
40
40
  *
41
- * The probe is synchronous and side-effect-free: it neither triggers nor
42
- * waits for the handshake. Call it from a render path, an event handler,
43
- * or a polling loop without worrying about cost.
41
+ * The probe is side-effect-free: it neither triggers nor waits for the
42
+ * handshake the returned promise resolves from the lib's cached state.
43
+ * The async signature is preserved for symmetry with the rest of the
44
+ * SDK surface (every other use-case method returns a promise) and to
45
+ * keep IPC bridges in consumer packages from having to special-case
46
+ * this one method.
44
47
  */
45
48
  export interface EebusUseCaseClient {
46
49
  /**
47
50
  * Probe the lib's cached readiness state for this use-case client.
48
51
  *
49
- * Returns `{ ready: true }` once the peer is fully bound and
50
- * subscribed. Returns `{ ready: false, reason }` while any
52
+ * Resolves to `{ ready: true }` once the peer is fully bound and
53
+ * subscribed. Resolves to `{ ready: false, reason }` while any
51
54
  * precondition is outstanding — {@link EebusUseCaseReadiness.reason}
52
55
  * carries the lib-published explanation so callers can distinguish
53
56
  * "peer is offline" from "peer does not support this use case" from
54
57
  * "binding is still in flight".
55
58
  *
56
- * Synchronous and side-effect-free. Safe to call from hot paths.
59
+ * Side-effect-free and cached — resolves immediately. Safe to call
60
+ * from hot paths.
57
61
  */
58
- ready: () => EebusUseCaseReadiness;
62
+ ready: () => Promise<EebusUseCaseReadiness>;
59
63
  }
@@ -44,15 +44,15 @@ export interface EebusVabdClient extends EebusUseCaseClient {
44
44
  getBatteryNominalCapacityWh: () => Promise<number | undefined>;
45
45
  /**
46
46
  * Return the most recent consolidated battery telemetry the SDK has
47
- * observed on this peer, without dispatching a wire read.
48
- * Synchronous and side-effect-free.
47
+ * observed on this peer, without dispatching a wire read. Resolves
48
+ * from the lib's cached snapshot — side-effect-free.
49
49
  *
50
- * Returns `undefined` until the first `measurementListData` notify
51
- * has landed. Once populated, the snapshot tracks every subsequent
52
- * notify — callers can drop their {@link onTelemetry} subscription
53
- * if they only need to poll the latest value.
50
+ * Resolves to `undefined` until the first `measurementListData`
51
+ * notify has landed. Once populated, the snapshot tracks every
52
+ * subsequent notify — callers can drop their {@link onTelemetry}
53
+ * subscription if they only need to poll the latest value.
54
54
  */
55
- getLastTelemetry: () => EebusVabdTelemetry | undefined;
55
+ getLastTelemetry: () => Promise<EebusVabdTelemetry | undefined>;
56
56
  /**
57
57
  * Subscribe to consolidated battery telemetry updates.
58
58
  */
@@ -38,12 +38,12 @@ export interface EebusVapdClient extends EebusUseCaseClient {
38
38
  getPvNominalPeakPowerW: () => Promise<number | undefined>;
39
39
  /**
40
40
  * Return the most recent consolidated PV telemetry the SDK has
41
- * observed on this peer, without dispatching a wire read.
42
- * Synchronous and side-effect-free.
41
+ * observed on this peer, without dispatching a wire read. Resolves
42
+ * from the lib's cached snapshot — side-effect-free.
43
43
  *
44
- * Returns `undefined` until the first inbound notify has landed.
44
+ * Resolves to `undefined` until the first inbound notify has landed.
45
45
  */
46
- getLastTelemetry: () => EebusVapdTelemetry | undefined;
46
+ getLastTelemetry: () => Promise<EebusVapdTelemetry | undefined>;
47
47
  /**
48
48
  * Subscribe to consolidated PV telemetry updates.
49
49
  */
package/dist/version.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export declare const SDK_VERSION = "0.0.145";
8
+ export declare const SDK_VERSION = "0.0.146";
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
package/dist/version.js CHANGED
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export const SDK_VERSION = '0.0.145';
8
+ export const SDK_VERSION = '0.0.146';
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enyo-energy/energy-app-sdk",
3
- "version": "0.0.145",
3
+ "version": "0.0.146",
4
4
  "description": "enyo Energy App SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",