Skip to content

Commit

Permalink
fix missing conn
Browse files Browse the repository at this point in the history
  • Loading branch information
huss committed Mar 9, 2024
1 parent 4531299 commit d8f7721
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/server/models/obvius/processConfigFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const Meter = require('../../models/Meter');
const ConfigFile = require('../../models/obvius/Configfile');
const moment = require('moment');
const Unit = require('../../models/Unit');
const { getConnection } = require('../../db');

/**
* Creates array of meters from a config file
Expand All @@ -28,6 +29,7 @@ async function processConfigFile(configFile) {
metersHash[internalMeterName] = { ...meter, [characteristic]: config[key] };
}
// TODO: the unit name needs to come from the config file
const conn = getConnection();
const kWhUnit = await Unit.getByName('kWh', conn);
let unitId;
if (kWhUnit === null) {
Expand Down

0 comments on commit d8f7721

Please sign in to comment.