- private static getMeasurandDefaultUnit(
- measurandType: OCPP16MeterValueMeasurand,
- ): MeterValueUnit | undefined {
- switch (measurandType) {
- case OCPP16MeterValueMeasurand.CURRENT_EXPORT:
- case OCPP16MeterValueMeasurand.CURRENT_IMPORT:
- case OCPP16MeterValueMeasurand.CURRENT_OFFERED:
- return MeterValueUnit.AMP;
- case OCPP16MeterValueMeasurand.ENERGY_ACTIVE_EXPORT_REGISTER:
- case OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER:
- return MeterValueUnit.WATT_HOUR;
- case OCPP16MeterValueMeasurand.POWER_ACTIVE_EXPORT:
- case OCPP16MeterValueMeasurand.POWER_ACTIVE_IMPORT:
- case OCPP16MeterValueMeasurand.POWER_OFFERED:
- return MeterValueUnit.WATT;
- case OCPP16MeterValueMeasurand.STATE_OF_CHARGE:
- return MeterValueUnit.PERCENT;
- case OCPP16MeterValueMeasurand.VOLTAGE:
- return MeterValueUnit.VOLT;
- }
- }
-
- private static isIdTagLocalAuthorized(chargingStation: ChargingStation, idTag: string): boolean {
- return (
- chargingStation.getLocalAuthListEnabled() === true &&
- chargingStation.hasIdTags() === true &&
- isNotEmptyString(
- chargingStation.idTagsCache
- .getIdTags(getIdTagsFile(chargingStation.stationInfo)!)
- ?.find((tag) => tag === idTag),
- )
- );
- }
-
- private static async isIdTagRemoteAuthorized(
- chargingStation: ChargingStation,
- idTag: string,
- ): Promise<boolean> {
- const authorizeResponse: OCPP16AuthorizeResponse =
- await chargingStation.ocppRequestService.requestHandler<
- OCPP16AuthorizeRequest,
- OCPP16AuthorizeResponse
- >(chargingStation, OCPP16RequestCommand.AUTHORIZE, {
- idTag: idTag,
- });
- return authorizeResponse?.idTagInfo?.status === OCPP16AuthorizationStatus.ACCEPTED;
- }
+ // private static getMeasurandDefaultUnit(
+ // measurandType: OCPP16MeterValueMeasurand,
+ // ): MeterValueUnit | undefined {
+ // switch (measurandType) {
+ // case OCPP16MeterValueMeasurand.CURRENT_EXPORT:
+ // case OCPP16MeterValueMeasurand.CURRENT_IMPORT:
+ // case OCPP16MeterValueMeasurand.CURRENT_OFFERED:
+ // return MeterValueUnit.AMP;
+ // case OCPP16MeterValueMeasurand.ENERGY_ACTIVE_EXPORT_REGISTER:
+ // case OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER:
+ // return MeterValueUnit.WATT_HOUR;
+ // case OCPP16MeterValueMeasurand.POWER_ACTIVE_EXPORT:
+ // case OCPP16MeterValueMeasurand.POWER_ACTIVE_IMPORT:
+ // case OCPP16MeterValueMeasurand.POWER_OFFERED:
+ // return MeterValueUnit.WATT;
+ // case OCPP16MeterValueMeasurand.STATE_OF_CHARGE:
+ // return MeterValueUnit.PERCENT;
+ // case OCPP16MeterValueMeasurand.VOLTAGE:
+ // return MeterValueUnit.VOLT;
+ // }
+ // }