openleadr-python icon indicating copy to clipboard operation
openleadr-python copied to clipboard

Implicit Event Cancellation

Open 00javad00 opened this issue 3 years ago • 1 comments

An implicit cancel occurs when an empty event is sent to the VEN via oadrDistributeEvent response (this could be because it was deleted in the VTN). Implicitly cancel events is normally not used, but it is mandatory to be implemented in VEN and it should handle event cancellation accordingly. To do this you may modify client.py to send a proper payload to on_event handler. i.e. send a None object indicating all event must be cancelled:

        elif response_type == 'oadrDistributeEvent':
            logger.info("The VTN called for oadrDistributeEvent.")
            if 'events' in response_payload and len(response_payload['events']) > 0:            
                await self._on_event(response_payload)
            else:
                await self.on_event(None)

00javad00 avatar Jul 29 '21 20:07 00javad00

I'll have to think about this. Event cancellation is a feature that I need to design on the client side, and that will then include implicit cancellations.

stan-janssen avatar Apr 09 '22 10:04 stan-janssen