elifTech / cpd-ocpp

Open Charge Point Protocol
https://www.eliftech.com/blog/48-a-diy-charging-point-for-an-electric-car-perspective-protocol-and-prototype
MIT License
64 stars 49 forks source link

the const values in commands not exported by the ocpp-eliftech package #9

Open MichaelHu2018 opened 4 years ago

MichaelHu2018 commented 4 years ago

the ocpp-eliftech package at https://www.npmjs.com/package/ocpp-eliftech seems not export the consts defined in each command.

for example in the command StatusNotification, the consts like these are not accessible from codebase that is using this package.

export const STATUS_SUSPENDEDEV = 'SuspendedEV'; export const STATUS_FINISHING = 'Finishing'; export const STATUS_RESERVED = 'Reserved'; export const STATUS_UNAVAILABLE = 'Unavailable'; export const STATUS_FAULTED = 'Faulted';

adam-nielsen commented 3 years ago

Have a look at the example code where they show how to access these:

import * as BootNotificationConst from 'ocpp-eliftech/dist/commands/BootNotification.js';

...

return {
    status: BootNotificationConst.STATUS_ACCEPTED,
};