require device config name to match device name
This is already the case for all device configs.
This commit is contained in:
parent
65e3e84583
commit
4503081dbf
1 changed files with 4 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
||||||
///<reference path="../util/jstypes.d.ts" />
|
///<reference path="../util/jstypes.d.ts" />
|
||||||
|
|
||||||
|
import assert from 'assert'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
|
||||||
import { loadAndMergeConfig } from './config-loader'
|
import { loadAndMergeConfig } from './config-loader'
|
||||||
|
@ -122,6 +123,9 @@ export async function loadDeviceConfigs(configPath: string) {
|
||||||
delete merged.type
|
delete merged.type
|
||||||
|
|
||||||
if (type == ConfigType.Device) {
|
if (type == ConfigType.Device) {
|
||||||
|
let configName = path.basename(configPath, '.yml')
|
||||||
|
let deviceName = merged.device.name
|
||||||
|
assert(configName === deviceName, `config name doesn't match device name (${deviceName}): ${configPath}`)
|
||||||
return [merged as DeviceConfig]
|
return [merged as DeviceConfig]
|
||||||
}
|
}
|
||||||
if (type == ConfigType.DeviceList) {
|
if (type == ConfigType.DeviceList) {
|
||||||
|
|
Loading…
Reference in a new issue