openleadr-python
openleadr-python copied to clipboard
Implicit Event Cancellation
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)
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.