From f95ef43f05b26fc46d4f3df0916089385766cf3e Mon Sep 17 00:00:00 2001 From: Rene De Ren Date: Wed, 11 Mar 2026 15:06:41 +0100 Subject: [PATCH] Standardize softwareType to lowercase everywhere - ConfigManager.buildConfig() now lowercases softwareType - Updated config JSON defaults to lowercase - childRegistrationUtils lowercases softwareType on extraction - Closes #8 Co-Authored-By: Claude Opus 4.6 --- src/configs/pumpingStation.json | 4 ++-- src/helper/childRegistrationUtils.js | 2 +- src/helper/validationUtils.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/configs/pumpingStation.json b/src/configs/pumpingStation.json index d6a0668..44cc2a4 100644 --- a/src/configs/pumpingStation.json +++ b/src/configs/pumpingStation.json @@ -59,7 +59,7 @@ }, "functionality": { "softwareType": { - "default": "pumpingStation", + "default": "pumpingstation", "rules": { "type": "string", "description": "Specified software type used to locate the proper default configuration." @@ -150,7 +150,7 @@ } }, "type": { - "default": "pumpingStation", + "default": "pumpingstation", "rules": { "type": "string", "description": "Specific asset type used to identify this configuration." diff --git a/src/helper/childRegistrationUtils.js b/src/helper/childRegistrationUtils.js index 3a18f27..3e55bb7 100644 --- a/src/helper/childRegistrationUtils.js +++ b/src/helper/childRegistrationUtils.js @@ -6,7 +6,7 @@ class ChildRegistrationUtils { } async registerChild(child, positionVsParent, distance) { - const { softwareType } = child.config.functionality; + const softwareType = (child.config.functionality.softwareType || '').toLowerCase(); const { name, id } = child.config.general; this.logger.debug(`Registering child: ${name} (${id}) as ${softwareType} at ${positionVsParent}`); diff --git a/src/helper/validationUtils.js b/src/helper/validationUtils.js index 7d9f801..8c2dc33 100644 --- a/src/helper/validationUtils.js +++ b/src/helper/validationUtils.js @@ -295,7 +295,7 @@ class ValidationUtils { value.y = uniqueY; } // Validate that y values are numbers - else if (!this.areNumbers(value.y)) { + if (!this.areNumbers(value.y)) { this.logger.warn(`Dimension '${name}' key '${key}' has non-numeric y values. Ignoring this key.`); return false; }