refactor: stricter type checking in conditions
[e-mobility-charging-stations-simulator.git] / src / charging-station / broadcast-channel / ChargingStationWorkerBroadcastChannel.ts
index f591bfbe86d0607bc96b9956a60f6321331e96d1..5188d974c33d6f65d87812b273731b25e0e789bd 100644 (file)
@@ -39,7 +39,7 @@ import {
 } from '../../types';
 import { Constants, convertToInt, isEmptyObject, isNullOrUndefined, logger } from '../../utils';
 import type { ChargingStation } from '../ChargingStation';
-import { getConfigurationKey } from '../ChargingStationConfigurationKeyUtils';
+import { getConfigurationKey } from '../ConfigurationKeyUtils';
 import { OCPP16ServiceUtils } from '../ocpp';
 
 const moduleName = 'ChargingStationWorkerBroadcastChannel';
@@ -194,7 +194,7 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne
                   requestPayload!.connectorId!,
                   this.chargingStation.getConnectorStatus(requestPayload!.connectorId!)!
                     .transactionId!,
-                  configuredMeterValueSampleInterval
+                  configuredMeterValueSampleInterval !== undefined
                     ? secondsToMilliseconds(convertToInt(configuredMeterValueSampleInterval.value))
                     : Constants.DEFAULT_METER_VALUES_INTERVAL,
                 ),
@@ -317,7 +317,7 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne
       this.cleanRequestPayload(command, requestPayload);
       return this.commandHandlers.get(command)!(requestPayload);
     }
-    throw new BaseError(`Unknown worker broadcast channel command: ${command}`);
+    throw new BaseError(`Unknown worker broadcast channel command: '${command}'`);
   }
 
   private cleanRequestPayload(