docile-charge-point icon indicating copy to clipboard operation
docile-charge-point copied to clipboard

Allow default message handlers

Open reinierl opened this issue 5 years ago • 0 comments

Hey guys, I added a feature to make docile-charge-point respond to any incoming request matching a certain pattern, regardless of the expectations the scripts may set up later.

For example:

handlingIncomingMessages(getConfigurationReq.respondingWith(GetConfigurationRes(List(), List()))) {
  handlingIncomingMessages(getLocalListVersionReq.respondingWith(GetLocalListVersionRes(AuthListNotSupported))) {

    bootNotification(chargePointVendor = "CIRCONTROL", chargePointModel = "R50 CCS CHA T2S32")

    for (i <- 0.to(2)) {
      statusNotification(scope = ConnectorScope(i), timestamp=Some(ZonedDateTime.now.withNano(0)))
    }
  }
}

That would send a BootNotification request, expect a BootNotification response, and then send a StatusNotification request and expect a corresponding response three times.

Any GetLocalListVersion request or GetConfiguration request that comes in in the mean time will be responded to with the default responses given in the top two lines. Moreover, they will be ignored for the purposes of the script's expectations, which is really nice because many production back-offices have a habit of messing up your carefully-crafted scripted with their GetConfiguration's and GetLocalListVersion's.

reinierl avatar Jan 06 '21 19:01 reinierl