Skip to content

Commit

Permalink
fix(energy): improve cumulative warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinBol committed Dec 13, 2024
1 parent 5d358f0 commit 3c49459
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,10 @@ class App {

if (driver.energy.cumulative === true) {
if (typeof driver.energy.cumulativeImportedCapability !== 'string') {
console.warn(`Warning: drivers.${driver.id} has energy.cumulative set to true, but is missing 'cumulativeImportedCapability'.`);
console.warn(`Warning: drivers.${driver.id} has energy.cumulative set to true, but is missing 'cumulativeImportedCapability'. Disregard this warning if the driver does not have \`meter_power\` capabilities.`);
}
if (typeof driver.energy.cumulativeExportedCapability !== 'string') {
console.warn(`Warning: drivers.${driver.id} has energy.cumulative set to true, but is missing 'cumulativeExportedCapability'.`);
console.warn(`Warning: drivers.${driver.id} has energy.cumulative set to true, but is missing 'cumulativeExportedCapability'. Disregard this warning if the driver does not have \`meter_power\` capabilities.`);
}
if (typeof driver.energy.cumulativeImportedCapability === 'string' && Capability.isInstanceOfId(driver.energy.cumulativeImportedCapability, 'meter_power') === false) {
throw new Error(`drivers.${driver.id} has 'cumulativeImportedCapability': '${driver.energy.cumulativeImportedCapability}' but only instances of 'meter_power' are allowed.`);
Expand Down

0 comments on commit 3c49459

Please sign in to comment.