@enyo-energy/energy-app-sdk 0.0.44 → 0.0.45
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.
- package/dist/cjs/implementations/appliances/appliance-manager.cjs +6 -10
- package/dist/cjs/implementations/appliances/appliance-manager.d.cts +2 -4
- package/dist/cjs/packages/energy-app-secret-manager.d.cts +1 -1
- package/dist/cjs/version.cjs +1 -1
- package/dist/cjs/version.d.cts +1 -1
- package/dist/implementations/appliances/appliance-manager.d.ts +2 -4
- package/dist/implementations/appliances/appliance-manager.js +6 -10
- package/dist/packages/energy-app-secret-manager.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -240,28 +240,24 @@ class ApplianceManager {
|
|
|
240
240
|
/**
|
|
241
241
|
* Updates metadata for an appliance.
|
|
242
242
|
* @param applianceId The ID of the appliance
|
|
243
|
-
* @param
|
|
243
|
+
* @param attributes The attributes to update
|
|
244
244
|
*/
|
|
245
|
-
async
|
|
245
|
+
async updateAppliance(applianceId, attributes) {
|
|
246
246
|
try {
|
|
247
247
|
const appliance = await this.energyApp.useAppliances().getById(applianceId);
|
|
248
248
|
if (appliance) {
|
|
249
249
|
const updatedAppliance = {
|
|
250
250
|
...appliance,
|
|
251
|
-
|
|
252
|
-
...appliance.metadata,
|
|
253
|
-
...metadata
|
|
254
|
-
}
|
|
251
|
+
...attributes
|
|
255
252
|
};
|
|
256
253
|
await this.energyApp.useAppliances().save(updatedAppliance, applianceId);
|
|
257
254
|
// Update cache
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
console.log(`Updated metadata for appliance ${applianceId}`);
|
|
255
|
+
this.applianceCache.set(applianceId, { id: applianceId, ...updatedAppliance });
|
|
256
|
+
console.log(`Updated appliance ${applianceId}`);
|
|
261
257
|
}
|
|
262
258
|
}
|
|
263
259
|
catch (error) {
|
|
264
|
-
console.error(`Failed to update
|
|
260
|
+
console.error(`Failed to update appliance ${applianceId}: ${error}`);
|
|
265
261
|
throw error;
|
|
266
262
|
}
|
|
267
263
|
}
|
|
@@ -132,11 +132,9 @@ export declare class ApplianceManager {
|
|
|
132
132
|
/**
|
|
133
133
|
* Updates metadata for an appliance.
|
|
134
134
|
* @param applianceId The ID of the appliance
|
|
135
|
-
* @param
|
|
135
|
+
* @param attributes The attributes to update
|
|
136
136
|
*/
|
|
137
|
-
|
|
138
|
-
connectionType: EnyoApplianceConnectionType;
|
|
139
|
-
}): Promise<void>;
|
|
137
|
+
updateAppliance(applianceId: string, attributes: Partial<EnyoAppliance>): Promise<void>;
|
|
140
138
|
/**
|
|
141
139
|
* Removes an appliance by its ID.
|
|
142
140
|
* @param applianceId The ID of the appliance to remove
|
|
@@ -79,5 +79,5 @@ export interface EnergyAppSecretManager {
|
|
|
79
79
|
* });
|
|
80
80
|
* ```
|
|
81
81
|
*/
|
|
82
|
-
saveSecret<T
|
|
82
|
+
saveSecret<T>(secretName: string, encryptionKey: string, secret: T): Promise<void>;
|
|
83
83
|
}
|
package/dist/cjs/version.cjs
CHANGED
|
@@ -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.
|
|
12
|
+
exports.SDK_VERSION = '0.0.45';
|
|
13
13
|
/**
|
|
14
14
|
* Gets the current SDK version.
|
|
15
15
|
* @returns The semantic version string of the SDK
|
package/dist/cjs/version.d.cts
CHANGED
|
@@ -132,11 +132,9 @@ export declare class ApplianceManager {
|
|
|
132
132
|
/**
|
|
133
133
|
* Updates metadata for an appliance.
|
|
134
134
|
* @param applianceId The ID of the appliance
|
|
135
|
-
* @param
|
|
135
|
+
* @param attributes The attributes to update
|
|
136
136
|
*/
|
|
137
|
-
|
|
138
|
-
connectionType: EnyoApplianceConnectionType;
|
|
139
|
-
}): Promise<void>;
|
|
137
|
+
updateAppliance(applianceId: string, attributes: Partial<EnyoAppliance>): Promise<void>;
|
|
140
138
|
/**
|
|
141
139
|
* Removes an appliance by its ID.
|
|
142
140
|
* @param applianceId The ID of the appliance to remove
|
|
@@ -237,28 +237,24 @@ export class ApplianceManager {
|
|
|
237
237
|
/**
|
|
238
238
|
* Updates metadata for an appliance.
|
|
239
239
|
* @param applianceId The ID of the appliance
|
|
240
|
-
* @param
|
|
240
|
+
* @param attributes The attributes to update
|
|
241
241
|
*/
|
|
242
|
-
async
|
|
242
|
+
async updateAppliance(applianceId, attributes) {
|
|
243
243
|
try {
|
|
244
244
|
const appliance = await this.energyApp.useAppliances().getById(applianceId);
|
|
245
245
|
if (appliance) {
|
|
246
246
|
const updatedAppliance = {
|
|
247
247
|
...appliance,
|
|
248
|
-
|
|
249
|
-
...appliance.metadata,
|
|
250
|
-
...metadata
|
|
251
|
-
}
|
|
248
|
+
...attributes
|
|
252
249
|
};
|
|
253
250
|
await this.energyApp.useAppliances().save(updatedAppliance, applianceId);
|
|
254
251
|
// Update cache
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
console.log(`Updated metadata for appliance ${applianceId}`);
|
|
252
|
+
this.applianceCache.set(applianceId, { id: applianceId, ...updatedAppliance });
|
|
253
|
+
console.log(`Updated appliance ${applianceId}`);
|
|
258
254
|
}
|
|
259
255
|
}
|
|
260
256
|
catch (error) {
|
|
261
|
-
console.error(`Failed to update
|
|
257
|
+
console.error(`Failed to update appliance ${applianceId}: ${error}`);
|
|
262
258
|
throw error;
|
|
263
259
|
}
|
|
264
260
|
}
|
|
@@ -79,5 +79,5 @@ export interface EnergyAppSecretManager {
|
|
|
79
79
|
* });
|
|
80
80
|
* ```
|
|
81
81
|
*/
|
|
82
|
-
saveSecret<T
|
|
82
|
+
saveSecret<T>(secretName: string, encryptionKey: string, secret: T): Promise<void>;
|
|
83
83
|
}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED